TABLES : t001 ,bseg ,bkpf ,knb1 , kna1 ,knvv.
" BSEG TABLOSU
DATA : BEGIN OF i_bseg OCCURS 0,
gsber LIKE bseg-gsber, "İŞ ALANI
umskz LIKE bseg-umskz, "ÖDK ALANI
END OF i_bseg.
"T001 TABLOSU
DATA : BEGIN OF i_t001 OCCURS 0,
bukrs LIKE t001-bukrs, "ŞİRKET KODU
END OF i_t001.
"BKPF TABLOSU
DATA : BEGIN OF i_bkpf OCCURS 0,
blart LIKE bkpf-blart, "BELGE TÜRÜ
END OF i_bkpf.
"KNB1 TABLOSU
DATA : BEGIN OF i_knb1 OCCURS 0 ,
kunnr LIKE knb1-kunnr, " MÜŞTERİ HESAP
END OF i_knb1.
"KNA1 TABLOSU
DATA :BEGIN OF i_kna1 OCCURS 0,
ktokd LIKE kna1-ktokd, "HESAP GRUBU
END OF i_kna1.
"KNVV TABLOSU
DATA : BEGIN OF i_knvv OCCURS 0,
kdgrp LIKE knvv-kdgrp, " MÜŞTERİ GRUBU
END OF i_knvv.
"TÜM ALANLARI BURADA BİRLEŞTİRDİK.
DATA : BEGIN OF itab OCCURS 0,
gsber LIKE i_bseg-gsber, "İŞ ALANI
umskz LIKE i_bseg-umskz, "ÖDK ALANI
bukrs LIKE i_t001-bukrs, "ŞİRKET KODU
blart LIKE i_bkpf-blart, "BELGE TÜRÜ
kunnr LIKE i_knb1-kunnr, " MÜŞTERİ HESAP
ktokd LIKE i_kna1-ktokd, "HESAP GRUBU
kdgrp LIKE i_knvv-kdgrp, " MÜŞTERİ GRUBU
END OF itab.
""PERFORMLAR
PERFORM get_data.
"hesap türü alanı
SELECTION-SCREEN BEGIN OF BLOCK hsptur WITH FRAME TITLE hsptr.
SELECT-OPTIONS : s_bukrs FOR t001-bukrs DEFAULT 4000,
s_gsber FOR bseg-gsber,
s_blart FOR bkpf-blart,
s_umskz FOR bseg-umskz DEFAULT 2.
SELECTION-SCREEN END OF BLOCK hsptur.
"tarih tipi
SELECTION-SCREEN BEGIN OF BLOCK trhtip WITH FRAME TITLE thtp.
SELECTION-SCREEN BEGIN OF LINE .
PARAMETERS : beltar RADIOBUTTON GROUP trtp DEFAULT 'X'.
SELECTION-SCREEN COMMENT 10(15) text-c01 FOR FIELD beltar.
PARAMETERS : kyttar RADIOBUTTON GROUP trtp .
SELECTION-SCREEN COMMENT 40(15) text-c02 FOR FIELD kyttar.
PARAMETERS : grstar RADIOBUTTON GROUP trtp .
SELECTION-SCREEN COMMENT 70(15) text-c03 FOR FIELD grstar.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK trhtip.
"belge tarihi
SELECTION-SCREEN BEGIN OF BLOCK blgtar WITH FRAME TITLE blgtr.
SELECTION-SCREEN BEGIN OF LINE .
PARAMETERS : bgn RADIOBUTTON GROUP bltr .
SELECTION-SCREEN COMMENT 10(15) text-r01 FOR FIELD bgn.
PARAMETERS : chft RADIOBUTTON GROUP bltr .
SELECTION-SCREEN COMMENT 30(15) text-r02 FOR FIELD chft.
PARAMETERS : cray RADIOBUTTON GROUP bltr DEFAULT 'X'.
SELECTION-SCREEN COMMENT 50(15) text-r03 FOR FIELD cray .
PARAMETERS : crayil RADIOBUTTON GROUP bltr .
SELECTION-SCREEN COMMENT 75(15) text-r04 FOR FIELD crayil.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS dgr RADIOBUTTON GROUP bltr .
SELECTION-SCREEN COMMENT 10(15) text-r05 FOR FIELD dgr.
SELECT-OPTIONS dates FOR sy-datlo .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE .
PARAMETERS : c_br AS CHECKBOX .
SELECTION-SCREEN COMMENT 10(25) text-c07 FOR FIELD c_br.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK blgtar.
"1. screen alanı
SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : c_ms AS CHECKBOX.
SELECTION-SCREEN COMMENT 10(25) text-c10 FOR FIELD c_ms.
SELECTION-SCREEN END OF LINE.
SELECT-OPTIONS : s_kunnr FOR knb1-kunnr,
s_ktokd FOR kna1-ktokd,
s_kdgrp FOR knvv-kdgrp.
SELECTION-SCREEN END OF SCREEN 100.
"2. screen alanı
SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : c_ms1 AS CHECKBOX.
SELECTION-SCREEN COMMENT 10(25) text-c09 FOR FIELD c_ms1.
SELECTION-SCREEN END OF LINE.
PARAMETERS : p1 TYPE c LENGTH 10,
p2 TYPE c LENGTH 10,
p3 TYPE c LENGTH 10.
SELECTION-SCREEN END OF SCREEN 200.
" 3. screen alanı
SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK blc3 WITH FRAME TITLE bl3 NO INTERVALS.
SELECTION-SCREEN END OF BLOCK blc3.
SELECTION-SCREEN END OF SCREEN 300.
SELECTION-SCREEN : BEGIN OF TABBED BLOCK blc1 FOR 10 LINES,
TAB (20) buton1 USER-COMMAND p1 ,
TAB (20) buton2 USER-COMMAND p2,
TAB (20) buton3 USER-COMMAND usr3 ,
END OF BLOCK blc1.
INITIALIZATION.
hsptr = 'HESAP TÜRÜ'.
thtp = 'TARİH TİPİ'.
buton1 = 'MÜŞTERİ HESABI'.
buton2 = 'SATICI HESABI'.
buton3 = 'SATICI HESABI'.
blgtr = 'BELGE TARİHİ'.
blc1-prog = sy-repid.
blc1-dynnr = 200.
blc1-activetab = 'P2'.
AT SELECTION-SCREEN.
CASE sy-dynnr.
WHEN 1000.
CASE sy-ucomm.
WHEN 'P1'.
blc1-dynnr = 100.
WHEN 'P2'.
blc1-dynnr = 200.
ENDCASE.
ENDCASE.
*&---------------------------------------------------------------------*
*& Form get_data
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM get_data.
SELECT t001~bukrs bkpf~blart
knb1~kunnr kna1~ktokd knvv~kdgrp
INTO CORRESPONDING FIELDS OF TABLE itab
FROM t001 INNER JOIN bkpf
ON t001~bukrs = bkpf~bukrs
INNER JOIN knb1
ON t001~bukrs = knb1~bukrs
INNER JOIN kna1
ON kna1~kunnr = knb1~kunnr
INNER JOIN knvv
ON kna1~kunnr = knvv~kunnr
WHERE t001-bukrs IN s_bukrs AND
bseg-gsber IN s_gsber AND
bkpf-blart IN s_blart AND
bseg-umskz IN s_umskz.
ENDFORM. "get_data
↧
hi everybody. This code is join part broken :( help me
↧