*& Report ZVVF_FIRO_TDS_DTL_ALL_ITEMS *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
REPORT ZVVF_FIRO_TDS_DTL_ALL_ITEMS
NO STANDARD PAGE HEADING
LINE-SIZE 240.
TABLES: with_item, bkpf, bseg, t059fb, t059z, t059zt, t059ot, bsid, bsis, lfa1.
TYPE-POOLS slis.
INCLUDE
INCLUDE : fp50mtxt.
data : w_answer(1) type c.
DATA : MESSG(50) TYPE C.
DATA : W_CDAT TYPE I.
* Internal Tables
* Internal table for bsis
DATA: BEGIN OF xbsis OCCURS 0,
bukrs LIKE bsis-bukrs,
belnr LIKE bsis-belnr,
gjahr LIKE bsis-gjahr,
buzei like bsis-buzei,
bupla LIKE bsis-bupla,
budat LIKE bsis-budat,
xbelnr LIKE bsis-xblnr,
qsskz LIKE bsis-qsskz,
shkzg LIKE bsis-shkzg,
WRbtr LIKE bsis-WRbtr,
dmbtr like bsis-dmbtr,
secco like bseg-secco,
valid(1),
augbl like bsas-augbl,
END OF xbsis.
* Internal table for bsas
DATA: BEGIN OF xbsas OCCURS 0,
bukrs LIKE bsas-bukrs,
belnr LIKE bsas-belnr,
gjahr LIKE bsas-gjahr,
buzei like bsas-buzei,
bupla LIKE bsas-bupla,
budat LIKE bsas-budat,
xbelnr LIKE bsas-xblnr,
* qsskz like bsas-qsskz,
shkzg LIKE bsas-shkzg,
WRbtr LIKE bsas-WRbtr,
dmbtr like bsas-dmbtr,
secco like bseg-secco,
augbl like bsas-augbl,
END OF xbsas.
*Internal table for with_item
DATA: BEGIN OF xwith_item OCCURS 0,
bukrs LIKE with_item-bukrs,
belnr LIKE with_item-belnr,
gjahr LIKE with_item-gjahr,
hkont LIKE with_item-hkont,
qsrec LIKE with_item-qsrec,
wt_qsshh LIKE with_item-wt_qsshh,
qsatz LIKE with_item-qsatz,
* WT_QBSHB like with_item-WT_QBSHB,
wt_acco LIKE with_item-wt_acco,
* wt_withcd LIKE with_item-wt_withcd,
wt_withcd(4) type c,
*-- ++ by Glen on 01.07.2002 for TDS certificate and Challan details
ctnumber LIKE with_item-ctnumber,
J_1IBUZEI like with_item-J_1IBUZEI,
j_1icertdt LIKE with_item-j_1icertdt,
j_1iintchln LIKE with_item-j_1iintchln,
j_1iintchdt LIKE with_item-j_1iintchdt,
* witht like with_item-witht,
witht(4) type c,
* QSREC like with_item-qsrec,
WT_ACCBS LIKE WITH_ITEM-WT_ACCBS,
WT_QSZRT LIKE WITH_ITEM-WT_QSZRT,
WT_ACCWT LIKE WITH_ITEM-WT_ACCWT,
END OF xwith_item.
* Final Internal Table
DATA: BEGIN OF xfinal OCCURS 0,
gjahr LIKE bsas-gjahr,
bukrs LIKE bsis-bukrs,
hkont LIKE with_item-hkont,
bupla LIKE bsis-bupla,
qsrec LIKE with_item-qsrec,
belnr LIKE with_item-belnr,
budat LIKE bsis-budat,
wt_acco LIKE with_item-wt_acco,
xblnr LIKE bsas-xblnr,
bill_dt LIKE WITH_ITEM-AUGDT,
wt_qsshh LIKE with_item-wt_qsshh,
qsatz LIKE with_item-qsatz,
* WT_QBSHB like with_item-WT_QBSHB,
shkzg LIKE bsis-shkzg,
WRbtr LIKE bsis-WRbtr,
dmbtr like bsis-dmbtr,
secco like bseg-secco,
*-- ++ by Glen on 01.07.2002 for TDS certificate and Challan details
ctnumber LIKE with_item-ctnumber,
j_1icertdt LIKE with_item-j_1icertdt,
j_1iintchln LIKE with_item-j_1iintchln,
j_1iintchdt LIKE with_item-j_1iintchdt,
j_1iextchln LIKE j_1iewtchln-j_1iextchln,
j_1iextchdt LIKE j_1iewtchln-j_1iextchdt,
* witht like with_item-witht,
* wt_withcd like with_item-wt_withcd,
witht LIKE WITH_ITEM-WITHT,
wt_withcd LIKE WITH_ITEM-WT_WITHCD,
w_tc LIKE T059O-WT_QSCOD,
* QSREC like with_item-qsrec,
blart like bkpf-blart,
stgrd(10) TYPE C,
xqfor like T059Z-xqfor,
WAERS LIKE BKPF-WAERS,
augbl like bsas-augbl,
a_belnr like bsas-belnr,
a_gjahr like bsas-gjahr,
WT_ACCBS LIKE WITH_ITEM-WT_ACCBS,
WT_ACCWT LIKE WITH_ITEM-WT_ACCWT,
WT_QSZRT LIKE WITH_ITEM-WT_QSZRT,
TDS_BASE LIKE WITH_ITEM-WT_QSSHH,
STBLG LIKE BKPF-STBLG,
END OF xfinal.
*DATA : w_tc(5) TYPE C.
* Internal table for G/L Accounts
DATA: BEGIN OF xt030 OCCURS 0,
konts LIKE t030-konts,
END OF xt030.
* Internal table for Challan Numbers
DATA: BEGIN OF i_challan OCCURS 0,
bukrs LIKE j_1iewtchln-bukrs,
gjahr LIKE j_1iewtchln-gjahr,
j_1iintchln LIKE j_1iewtchln-j_1iintchln,
j_1iintchdt LIKE j_1iewtchln-j_1iintchdt,
j_1iextchln LIKE j_1iewtchln-j_1iextchln,
j_1iextchdt LIKE j_1iewtchln-j_1iextchdt,
END OF i_challan.
* Variables
DATA: sumqsshh LIKE with_item-wt_qsshh,
sumqbshb LIKE bsis-WRbtr,
hkont LIKE bsis-hkont,
pbupla LIKE bsis-bupla,
pwt_acco LIKE with_item-wt_acco,
gqsshh TYPE p DECIMALS 2,
gqbshb TYPE p DECIMALS 2,
vend TYPE p,
belnr LIKE with_item-belnr,
w_secco like bseg-secco.
**---------------------------------------------------------------------*
* Constants Begin with C_
**---------------------------------------------------------------------*
CONSTANTS: st_formname_top_of_page TYPE slis_formname
VALUE 'TOP_OF_PAGE-ALV'.
**---------------------------------------------------------------------*
* Data Begin with W_
**---------------------------------------------------------------------*
*-------- Declarations for ALV Grid.
DATA: it_st_list_top_of_page TYPE slis_t_listheader,
it_st_fieldcat TYPE slis_t_fieldcat_alv,
it_st_events TYPE slis_t_event,
st_layout TYPE slis_layout_alv,
s_status TYPE slis_formname VALUE 'STANDARD_ST01',
s_user_command TYPE slis_formname VALUE 'USER_COMMAND-ALV',
s_repid LIKE sy-repid,
s_save(1) TYPE c,
s_variant LIKE disvariant,
code LIKE disvariant-handle.
data : w_date_t(10) type c,
w_date_f(10) type c.
DATA : BEGIN OF seltab OCCURS 0.
INCLUDE STRUCTURE RSPARAMS.
DATA : END OF SELTAB.
**---------------------------------------------------------------------*
* Initialisation
**---------------------------------------------------------------------*
INITIALIZATION.
s_repid = sy-repid.
s_save = 'A'.
PERFORM eventtab_build USING it_st_events[].
PERFORM variant_init.
*Selection screen
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
parameter : p_bukrs like bsis-bukrs obligatory.
selection-screen : skip 1.
SELECT-OPTIONS: budat FOR bsis-budat OBLIGATORY,
witht FOR with_item-witht OBLIGATORY,
qsskz FOR t059z-wt_withcd,
* WT_ACCO for with_item-WT_ACCO,
wt_acco FOR lfa1-lifnr,
* bupla FOR bsis-bupla,
secco for bseg-secco,
qsrec FOR with_item-qsrec. " obligatory.
SELECTION-SCREEN END OF BLOCK b1.
TOP-OF-PAGE.
* PERFORM top_of_page.
START-OF-SELECTION.
PERFORM get_glacct_from_wttype.
PERFORM unpack_vendor.
IF xt030[] IS INITIAL.
MESSAGE i000(38) WITH 'No Data Retrieved for your selection'.
EXIT.
ENDIF.
* Get Basic Data from BSIS table
SELECT bukrs belnr gjahr buzei bupla budat xblnr qsskz shkzg WRbtr dmbtr
INTO corresponding fields of TABLE xbsis
FROM bsis CLIENT SPECIFIED
FOR ALL ENTRIES IN xt030
WHERE mandt = sy-mandt
AND bukrs = p_bukrs
AND augbl = ' '
AND budat IN budat
AND hkont = xt030-konts
AND qsskz IN qsskz .
* Get Basic Data from BSaS table
SELECT bukrs belnr gjahr buzei bupla budat xblnr
* qsskz
shkzg WRBTR dmbtr augbl
INTO corresponding fields of TABLE xbsas
FROM bsas CLIENT SPECIFIED
FOR ALL ENTRIES IN xt030
WHERE mandt = sy-mandt
AND bukrs = p_bukrs
* AND AUGBL = ' ' " Bijoy - 22/10/2001
AND budat IN budat
AND hkont = xt030-konts .
.
* AND QSSKZ in qsskz
* AND bupla IN bupla .
LOOP AT xbsas.
CLEAR xbsis.
MOVE-CORRESPONDING xbsas TO xbsis.
APPEND xbsis.
ENDLOOP.
loop at xbsis.
clear : w_secco.
select single secco
into (w_secco)
from bseg
where bukrs = xbsis-bukrs
and belnr = xbsis-belnr
and gjahr = xbsis-gjahr
and buzei = xbsis-buzei.
if sy-subrc eq 0.
if w_secco in secco.
xbsis-secco = w_secco.
xbsis-valid = 'Y'.
modify xbsis.
endif.
endif.
endloop.
delete xbsis where valid is initial.
IF xbsis[] IS INITIAL.
MESSAGE i000(38) WITH 'No Data Retrieveid for your selection'.
EXIT.
ENDIF.
*-- 01.07.2002 Itab xbis sorted by BELNR before deleting duplicates
SORT xbsis BY bukrs belnr gjahr buzei.
DELETE ADJACENT DUPLICATES FROM xbsis COMPARING bukrs belnr
gjahr buzei.
SELECT bukrs belnr gjahr hkont qsrec wt_qsshh qsatz wt_acco wt_withcd
ctnumber J_1IBUZEI j_1icertdt j_1iintchln j_1iintchdt witht
WT_ACCBS WT_QSZRT WT_ACCWT
"01.07.2002 - Glen
INTO TABLE xwith_item
FROM with_item CLIENT SPECIFIED
FOR ALL ENTRIES IN xbsis
WHERE mandt = sy-mandt
AND bukrs = xbsis-bukrs
AND belnr = xbsis-belnr
AND gjahr = xbsis-gjahr
* and J_1IBUZEI = xbsis-buzei
AND wt_qbshb <> 0
AND wt_acco IN wt_acco
AND qsrec IN qsrec
AND witht IN witht.
*-- 02.07.2002 - Glenn
*-- To get external challan numbers and date from j_1iewtchln table.
*-- This table maintains the ext. challan No against the internal
*-- challan number.
SELECT bukrs gjahr j_1iintchln j_1iintchdt j_1iextchln j_1iextchdt
INTO CORRESPONDING FIELDS OF TABLE i_challan
FROM j_1iewtchln.
* Create Final Data for report
PERFORM create_final_data.
IF xfinal[] IS INITIAL.
MESSAGE i000(38) WITH 'No data retrieved for your selection'.
EXIT.
ENDIF.
SORT xfinal BY hkont wt_acco bupla.
PERFORM display_report.
PERFORM comment_build USING it_st_list_top_of_page[]. "dISPLAY hEADING IN ALV
PERFORM fieldcat USING it_st_fieldcat[]. "PUT DATA IN ALV
PERFORM layout_build USING st_layout.
PERFORM reuse_alv_list_display.
AT LINE-SELECTION.
belnr = sy-lisel+20(10).
READ TABLE xwith_item WITH KEY bukrs = p_bukrs
belnr = belnr.
IF sy-subrc <> 0.
* MESSAGE i000(38) WITH 'Please select valid line'.
ELSE.
SET PARAMETER ID 'BLN' FIELD xfinal-belnr.
SET PARAMETER ID 'BUK' FIELD 'MIL'.
SET PARAMETER ID 'GJR' FIELD xwith_item-gjahr.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
CLEAR belnr.
ENDIF.
*&---------------------------------------------------------------------*
*& Form TOP_OF_PAGE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM top_of_page.
NEW-LINE.
WRITE AT (sy-linsz) sy-datum RIGHT-JUSTIFIED.
NEW-LINE.
WRITE AT (sy-linsz) text-002 CENTERED.
NEW-LINE.
WRITE AT (sy-linsz) text-003 CENTERED.
IF budat-high IS INITIAL.
budat-high = budat-low.
ENDIF.
WRITE:/50 text-004,
budat-low COLOR COL_KEY,
' To ',
budat-high COLOR COL_KEY.
SKIP.
ULINE.
WRITE:/ sy-vline NO-GAP,
text-011 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-013 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-058 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-054 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-056 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-014 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-015 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-016 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-017 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-018 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-019 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
* text-060 CENTERED COLOR COL_HEADING NO-GAP,
* sy-vline NO-GAP,
*
text-020 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-021 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-022 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
*-- ++ Glen to display TDS Cert, Cert Date, Challan No, Challan Date
text-050 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-052 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-045 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-047 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-042 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-042 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP.
WRITE:/ sy-vline NO-GAP,
text-031 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-033 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-059 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-055 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-057 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-034 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-035 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-036 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-037 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-038 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-039 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
* text-061 CENTERED COLOR COL_HEADING NO-GAP,
* sy-vline NO-GAP,
text-040 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-041 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-048 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-051 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-053 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
*-- ++ Glen to display TDS Cert, Cert Date, Challan No, Challan Date
text-046 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-044 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-043 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP,
text-044 CENTERED COLOR COL_HEADING NO-GAP,
sy-vline NO-GAP.
ENDFORM. " TOP_OF_PAGE
*&---------------------------------------------------------------------*
*& Form GET_GLACCT_FROM_WTTYPE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM get_glacct_from_wttype.
SELECT konts INTO TABLE xt030
FROM t030 CLIENT SPECIFIED
WHERE mandt = sy-mandt
AND ktopl = 'VCOA'
AND ktosl = 'WIT'
AND bwmod IN witht.
ENDFORM. " GET_GLACCT_FROM_WTTYPE
*&---------------------------------------------------------------------*
*& Form UNPACK_VENDOR
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM unpack_vendor.
LOOP AT wt_acco.
IF NOT wt_acco-low IS INITIAL.
vend = wt_acco-low.
UNPACK vend TO wt_acco-low.
ELSEIF NOT wt_acco-high IS INITIAL.
vend = wt_acco-high.
UNPACK vend TO wt_acco-high.
ENDIF.
MODIFY wt_acco.
ENDLOOP.
ENDFORM. " UNPACK_VENDOR
*&---------------------------------------------------------------------*
*& Form DISPLAY_REPORT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM display_report.
LOOP AT xfinal.
if xfinal-witht = 'I1' or xfinal-witht = 'P1'.
XFINAL-w_tc = '192'.
endif.
if xfinal-witht = 'I2' or xfinal-witht = 'P2'.
XFINAL-w_tc = '194A'.
endif.
if xfinal-witht = 'I3' or xfinal-witht = 'P3'.
XFINAL-w_tc = '194C'.
endif.
if xfinal-witht = 'I4' or xfinal-witht = 'P4'.
XFINAL-w_tc = '194H'.
endif.
if xfinal-witht = 'I5' or xfinal-witht = 'P5'.
XFINAL-w_tc = '194I'.
endif.
if xfinal-witht = 'I6' or xfinal-witht = 'P6'.
XFINAL-w_tc = '194J'.
endif.
if xfinal-witht = 'I7' or xfinal-witht = 'P7'.
XFINAL-w_tc = '195'.
endif.
*****calculate rate
select single xqfor into xfinal-xqfor from T059Z where witht = xfinal-witht and WT_WITHCD = xfinal-WT_WITHCD and land1 = 'IN'.
if xfinal-xqfor eq space.
else.
select single qsatz into xfinal-qsatz from t059fb where witht = xfinal-witht and WT_WITHCD = xfinal-WT_WITHCD and
qsatz ne space and land1 = 'IN'.
endif.
IF XFINAL-WT_QSZRT NE SPACE.
XFINAL-QSATZ = ( 1 - ( XFINAL-WT_QSZRT / 100 ) ) * XFINAL-QSATZ.
ENDIF.
IF XFINAL-WT_ACCWT NE SPACE.
XFINAL-TDS_BASE = XFINAL-WT_QSSHH.
ELSE.
XFINAL-TDS_BASE = XFINAL-WT_QSSHH + XFINAL-WT_ACCBS.
ENDIF.
IF xfinal-shkzg = 'H'.
xfinal-WRbtr = 0 - xfinal-WRbtr.
IF xfinal-wt_qsshh > 0.
xfinal-wt_qsshh = 0 - xfinal-wt_qsshh.
ENDIF.
ENDIF.
SHIFT XFINAL-HKONT LEFT DELETING LEADING '0'.
SHIFT XFINAL-WT_ACCO LEFT DELETING LEADING '0'.
select single gjahr belnr into (xfinal-a_gjahr,xfinal-a_belnr) from bsas where belnr = xfinal-augbl.
IF XFINAL-STBLG NE SPACE AND XFINAL-STGRD EQ SPACE.
XFINAL-DMBTR = XFINAL-DMBTR * ( -1 ).
ENDIF.
MODIFY xfinal.
IF sy-tabix = 1.
ULINE.
pbupla = xfinal-bupla.
pwt_acco = xfinal-wt_acco.
ENDIF.
HIDE: xfinal-belnr.
ENDLOOP.
ENDFORM. " DISPLAY_REPORT
*&---------------------------------------------------------------------*
*& Form CREATE_FINAL_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM create_final_data.
LOOP AT xbsis.
MOVE-CORRESPONDING xbsis TO xfinal.
CLEAR xwith_item.
READ TABLE xwith_item WITH KEY bukrs = xbsis-bukrs
belnr = xbsis-belnr
gjahr = xbsis-gjahr
J_1IBUZEI = xbsis-buzei .
IF sy-subrc = 0.
MOVE-CORRESPONDING xwith_item TO xfinal.
*-- ++ by Glenn - 02.07.2002
*-- Get the challan number and challan date from the challan data by
*-- reading the internal table i_challan. The external challan number
*-- and the corresponding date is updated in the final itab from the
*-- challan details. The external challan number and challan date are
*-- derived from the internal challan no and challan date from the
*-- WITH_ITEM table.
CLEAR i_challan.
READ TABLE i_challan WITH KEY bukrs = xbsis-bukrs
gjahr = xbsis-gjahr
j_1iintchln = xfinal-j_1iintchln
j_1iintchdt = xfinal-j_1iintchdt.
IF sy-subrc = 0.
xfinal-j_1iextchln = i_challan-j_1iextchln.
xfinal-j_1iextchdt = i_challan-j_1iextchdt.
ENDIF.
CHECK xfinal-wt_acco IN wt_acco.
SELECT SINGLE * FROM bkpf CLIENT SPECIFIED
WHERE mandt = sy-mandt
AND bukrs = xbsis-bukrs
AND belnr = xbsis-belnr
AND gjahr = xbsis-gjahr.
CONDENSE bkpf-bktxt NO-GAPS.
xfinal-bill_dt = bkpf-BLDAT.
xfinal-xblnr = bkpf-xblnr.
xfinal-blart = bKpf-blart.
XFINAL-WAERS = BKPF-WAERS.
XFINAL-STgrd = BKPF-STgrd.
XFINAL-STBLG = BKPF-STBLG.
if bkpf-stBLG ne space.
xfinal-STBLG = 'REV'.
endif.
APPEND xfinal.CLEAR xfinal.
ENDIF.
ENDLOOP.
ENDFORM. " CREATE_FINAL_DATA
*&---------------------------------------------------------------------*
*& Form LAYOUT_BUILD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_ST_LAYOUT text
*----------------------------------------------------------------------*
FORM layout_build USING p_st_layout TYPE slis_layout_alv.
p_st_layout-box_fieldname = 'SELK'. " Checkbox
p_st_layout-get_selinfos = 'X'.
p_st_layout-f2code = 'PICK' . " Doppelklickfunktion
p_st_layout-confirmation_prompt = 'X'. "Sicherheitsabfrage
p_st_layout-key_hotspot = 'X'. "Schlüssel als Hotspot
p_st_layout-info_fieldname = 'COL'. "Zeilenfarbe
ENDFORM. " LAYOUT_BUILD
*&---------------------------------------------------------------------*
*& Form REUSE_ALV_LIST_DISPLAY
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM reuse_alv_list_display .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = S_REPID
* I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'MY_USER_COMMAND'
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
I_BACKGROUND_ID = 'ALV_BACKGROUND'
* I_GRID_TITLE =
* I_GRID_SETTINGS =
* IS_LAYOUT =
IT_FIELDCAT = it_st_fieldcat[]
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS = IT_slis_t_specialcol_alv[]
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
I_SAVE = 'A'
* IS_VARIANT =
IT_EVENTS = IT_ST_EVENTS[]
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* I_HTML_HEIGHT_TOP =
* I_HTML_HEIGHT_END =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = XFINAL
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " REUSE_ALV_LIST_DISPLAY
*&---------------------------------------------------------------------*
*& Form EVENTTAB_BUILD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_IT_ST_EVENTS[] text
*----------------------------------------------------------------------*
FORM eventtab_build USING p_st_events TYPE slis_t_event .
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = p_st_events.
READ TABLE p_st_events WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE st_formname_top_of_page TO ls_event-form.
APPEND ls_event TO p_st_events.
ENDIF.
ENDFORM. " EVENTTAB_BUILD
*&---------------------------------------------------------------------*
*& Form VARIANT_INIT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM variant_init .
CLEAR s_variant.
s_variant-report = s_repid.
s_variant-handle = code.
ENDFORM. " VARIANT_INIT
*&--------------------------------------------------------------------*
*& Form comment_build
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
* -->P_IT_ST_LIStextP_OF_PAGE
*---------------------------------------------------------------------*
FORM comment_build USING p_it_st_list_top_of_page TYPE slis_t_listheader.
DATA: ls_line TYPE slis_listheader,
mix_date(130) type c,
mix(130) type c,
head_label(130) type c value 'TDS Report'.
REFRESH p_it_st_list_top_of_page.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = head_label.
APPEND ls_line TO p_it_st_list_top_of_page.
if BUDAT-low ne SPACE and BUDAT-low gt 0.
concatenate BUDAT-LOW+6(2) '-' BUDAT-LOW+4(2) '-'
BUDAT-LOW(4) into w_date_f.
concatenate BUDAT-high+6(2) '-' BUDAT-high+4(2) '-'
BUDAT-high(4) into w_date_t.
concatenate 'Posting Date :' ' ' w_date_f '-' w_date_t into
mix
SEPARATED BY SPACE.
ls_line-typ = 'S'.
ls_line-info = mix.
APPEND ls_line TO p_it_st_list_top_of_page.
endif.
clear mix.
concatenate 'Withholding Tax Type :' ' ' witht-low ' ' witht-high into mix SEPARATED BY SPACE.
ls_line-typ = 'S'.
ls_line-info = mix.
APPEND ls_line TO p_it_st_list_top_of_page.
clear mix.
concatenate 'Vendor :' ' ' wt_acco-low ' ' wt_acco-high into mix SEPARATED BY SPACE.
ls_line-typ = 'S'.
ls_line-info = mix.
APPEND ls_line TO p_it_st_list_top_of_page.
* clear mix.
* concatenate 'Business Place :' ' ' bupla-low ' ' bupla-high into mix SEPARATED BY SPACE.
* ls_line-typ = 'S'.
* ls_line-info = mix.
* APPEND ls_line TO p_it_st_list_top_of_page.
clear mix.
concatenate 'Section Code :' ' ' secco-low ' ' secco-high into mix SEPARATED BY SPACE.
ls_line-typ = 'S'.
ls_line-info = mix.
APPEND ls_line TO p_it_st_list_top_of_page.
clear mix.
concatenate 'Recipient type :' ' ' qsrec-low ' ' qsrec-high into mix SEPARATED BY SPACE.
ls_line-typ = 'S'.
ls_line-info = mix.
APPEND ls_line TO p_it_st_list_top_of_page.
clear mix.
ENDFORM. " COMMENT_BUILD
*&--------------------------------------------------------------------*
*& Form TOP_OF_PAGE-ALV
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM top_of_page-alv.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_st_list_top_of_page.
ENDFORM. "TOP_OF_PAGE-ALV
*&--------------------------------------------------------------------*
*& Form fieldcat
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
* -->P_IT_ST_FIEtextT
*---------------------------------------------------------------------*
FORM fieldcat USING p_it_st_fieldcat TYPE slis_t_fieldcat_alv.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
*SALES DOCUMENTS
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'HKONT'.
* ls_fieldcat-datatype = 'CHAR'.
ls_fieldcat-outputlen = 10.
ls_fieldcat-seltext_m = 'TDS Acct' .
* ls_fieldcat-rollname = 'BELNR'.
ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'SECCO'.
* ls_fieldcat-datatype = 'CHAR'.
ls_fieldcat-outputlen = 4.
ls_fieldcat-seltext_m = 'Sec Code' .
* ls_fieldcat-rollname = 'BELNR'.
ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'W_TC'.
* ls_fieldcat-datatype = 'CHAR'.
ls_fieldcat-outputlen = 5.
ls_fieldcat-seltext_m = 'IT Sec' .
ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'WITHT'.
ls_fieldcat-datatype = 'CHAR'.
ls_fieldcat-outputlen = 4.
ls_fieldcat-seltext_m = 'TDS Typ' .
ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'WT_WITHCD'.
ls_fieldcat-seltext_m = 'TDS Cod'.
* ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 4.
ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
*GL A/C FOR SALES
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'QSREC'.
* ls_fieldcat-rollname = 'WERKS'.
* ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 4.
ls_fieldcat-key ='X'.
ls_fieldcat-seltext_m = 'Recipient' .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'BLART'.
* ls_fieldcat-rollname = 'FKART'.
* ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 4.
ls_fieldcat-seltext_m = 'Doc Typ' .
ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'STBLG'.
* ls_fieldcat-rollname = 'FKART'.
* ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 8.
ls_fieldcat-seltext_m = 'REVERSAL' .
ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'BELNR'.
* ls_fieldcat-rollname = 'FKART'.
* ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 10.
ls_fieldcat-seltext_m = 'Doc No' .
ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
*
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'BUDAT'.
* ls_fieldcat-rollname = 'MWSKZ'.
* ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 4.
ls_fieldcat-seltext_m = 'Posting Date' .
ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'WT_ACCO'.
* ls_fieldcat-rollname = 'MAKTX'.
* ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 10.
ls_fieldcat-seltext_m = 'Vendor No' .
* ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'XBLNR'.
* ls_fieldcat-rollname = 'MAKTX'.
* ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 10.
ls_fieldcat-seltext_m = 'BILL NO' .
* ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'BILL_DT'.
* ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 10.
ls_fieldcat-seltext_m = 'BILL DATE' .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'WT_QSSHH'.
* ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = 'BILL AMT' .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'TDS_BASE'.
* ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = 'TDS BASE'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
* CLEAR ls_fieldcat.
* ls_fieldcat-fieldname = 'WAERS'.
** ls_fieldcat-ddictxt = 'L'.
* ls_fieldcat-outputlen = 13.
* ls_fieldcat-seltext_m = 'CURR' .
* APPEND ls_fieldcat TO p_it_st_fieldcat.
*
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'QSATZ'.
* ls_fieldcat-rollname = 'MATNR'.
* ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = 'TDS %' .
APPEND ls_fieldcat TO p_it_st_fieldcat.
* CLEAR ls_fieldcat.
* ls_fieldcat-fieldname = 'WRBTR'.
** ls_fieldcat-ddictxt = 'L'.
* ls_fieldcat-outputlen = 13.
* ls_fieldcat-seltext_m = 'TDS AMOUNT'.
* APPEND ls_fieldcat TO p_it_st_fieldcat.
*
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'DMBTR'.
* ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = 'TDS AMT'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'J_1IINTCHLN'.
* ls_fieldcat-rollname = 'MATNR'.
* ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-hotspot = 'X'.
ls_fieldcat-seltext_m = 'Int Chln No'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'J_1IINTCHDT'.
* ls_fieldcat-rollname = 'MATNR'.
* ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-seltext_m = 'Int Chln Dt'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'J_1IEXTCHLN'.
* ls_fieldcat-rollname = 'MATNR'.
** ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 13.
ls_fieldcat-hotspot = 'X'.
ls_fieldcat-seltext_m = 'Ext Chln No' .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'J_1IEXTCHDT'.
* ls_fieldcat-rollname = 'MATNR'.
* ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 10.
ls_fieldcat-seltext_m = 'Ext Chln Dt' .
APPEND ls_fieldcat TO p_it_st_fieldcat.
*
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'CTNUMBER'.
* ls_fieldcat-rollname = 'MATNR'.
* ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 10.
ls_fieldcat-hotspot = 'X'.
ls_fieldcat-seltext_m = 'TDS Cert No'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
*
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'J_1ICERTDT'.
* ls_fieldcat-rollname = 'MATNR'.
* ls_fieldcat-ddictxt = 'L'.
ls_fieldcat-outputlen = 10.
ls_fieldcat-seltext_m = 'TDS Cert Dt' .
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.
ENDFORM. " FIELDCAT
*&--------------------------------------------------------------------*
*& Form MY_USER_COMMAND
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
* -->UCOMM text
* -->SELFIELD text
*---------------------------------------------------------------------*
FORM MY_USER_COMMAND USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
data: iqm like xfinal-J_1IINTCHLN,
f1 like xfinal-J_1IINTCHLN,
buk like xfinal-bukrs,
b1 like xfinal-bukrs.
CASE selfield-fieldname.
WHEN 'J_1IINTCHLN'. "Notification
READ TABLE XFINAL INDEX selfield-tabindex.
IF xfinal-J_1IINTCHLN EQ space.
PERFORM POP_TAB.
SUBMIT J_1I_CHALLAN_UPDATE WITH SELECTION-TABLE seltab AND RETURN.
else.
MESSG = 'Internal Challan already exist'.
PERFORM FORM2_PERFORM USING MESSG.
IF SY-SUBRC = 0.
IF W_ANSWER = '1'.
PERFORM POP_TAB_R.
SUBMIT J_1IEWT_CHALLAN_REVERSE WITH SELECTION-TABLE seltab AND RETURN.
ELSEIF W_ANSWER = '2'.
ELSE.
ENDIF.
ENDIF.
ENDIF.
WHEN 'J_1IEXTCHLN'. "Notification
READ TABLE XFINAL INDEX selfield-tabindex.
IF xfinal-J_1IINTCHLN NE space AND xfinal-J_1IEXTCHLN EQ space.
PERFORM POP_TAB_U.
SUBMIT J_1IEWT_BANK_UPDATE WITH SELECTION-TABLE seltab AND RETURN.
ENDIF.
WHEN 'CTNUMBER'.
READ TABLE XFINAL INDEX selfield-tabindex.
IF xfinal-J_1IINTCHLN NE space AND xfinal-J_1IEXTCHLN NE space AND xfinal-CTNUMBER EQ space.
PERFORM POP_TAB2.
SUBMIT ZVVF_J_1IEWT_CERT WITH SELECTION-TABLE seltab AND RETURN.
elseIF xfinal-J_1IINTCHLN NE space AND xfinal-J_1IEXTCHLN NE space AND xfinal-CTNUMBER ne space.
MESSG = 'TDS Certificate already exists'.
PERFORM FORM3_PERFORM USING MESSG.
IF SY-SUBRC = 0.
IF W_ANSWER = '1'.
W_CDAT = 1.
* SUBMIT SAPMFO5R WITH SELECTION-TABLE seltab AND RETURN.
PERFORM POP_TAB1.
SUBMIT ZVVF_J_1IEWT_CERT_REPRINT WITH SELECTION-TABLE seltab AND RETURN.
ELSEIF W_ANSWER = '2'.
W_CDAT = 2.
PERFORM POP_TAB1.
SUBMIT J_1IEWT_CERT_CANC WITH SELECTION-TABLE seltab AND RETURN.
ELSE.
ENDIF.
ENDIF.
endif.
endcase.
endform. "MY_USER_COMMAND
*&--------------------------------------------------------------------*
*& Form POP_TAB
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM POP_TAB.
REFRESH SELTAB.
CLEAR SELTAB.
seltab-selname = 'ZBUKRS'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-bukrs.
APPEND seltab.
seltab-selname = 'ZYEAR'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-GJAHR.
APPEND seltab.
seltab-selname = 'ZSECCODE'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-SECCO.
APPEND seltab.
seltab-selname = 'ZDOC'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-BELNR.
APPEND seltab.
seltab-selname = 'ZSECT'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-W_TC.
APPEND seltab.
seltab-selname = 'ZVENDOR'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-WT_ACCO.
APPEND seltab.
seltab-selname = 'ZREC'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-QSREC.
APPEND seltab.
ENDFORM. "POP_TAB
*&--------------------------------------------------------------------*
*& Form form2_perform
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
* -->MESSG text
*---------------------------------------------------------------------*
form form2_perform using messg type c.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
* TITLEBAR = ' '
* DIAGNOSE_OBJECT = ' '
TEXT_QUESTION = messg
TEXT_BUTTON_1 = 'YES'(062)
* ICON_BUTTON_1 = ' '
TEXT_BUTTON_2 = 'NO'(063)
* ICON_BUTTON_2 = ' '
DEFAULT_BUTTON = '2'
DISPLAY_CANCEL_BUTTON = ' '
* USERDEFINED_F1_HELP = ' '
* START_COLUMN = 25
* START_ROW = 6
* POPUP_TYPE =
* IV_QUICKINFO_BUTTON_1 = ' '
* IV_QUICKINFO_BUTTON_2 = ' '
IMPORTING
ANSWER = w_answer
* TABLES
* PARAMETER =
EXCEPTIONS
TEXT_NOT_FOUND = 1
OTHERS = 2
.
endform. "form2_perform
form form3_perform using messg type c.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
* TITLEBAR = ' '
* DIAGNOSE_OBJECT = ' '
TEXT_QUESTION = messg
TEXT_BUTTON_1 = 'YES'(064)
* ICON_BUTTON_1 = ' '
TEXT_BUTTON_2 = 'NO'(065)
* ICON_BUTTON_2 = ' '
DEFAULT_BUTTON = '2'
DISPLAY_CANCEL_BUTTON = 'X'
* USERDEFINED_F1_HELP = ' '
* START_COLUMN = 25
* START_ROW = 6
* POPUP_TYPE =
* IV_QUICKINFO_BUTTON_1 = ' '
* IV_QUICKINFO_BUTTON_2 = ' '
IMPORTING
ANSWER = w_answer
* TABLES
* PARAMETER =
EXCEPTIONS
TEXT_NOT_FOUND = 1
OTHERS = 2
.
endform. "form2_perform
FORM POP_TAB1.
REFRESH SELTAB.
CLEAR SELTAB.
seltab-selname = 'ZBUKRS'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-bukrs.
APPEND seltab.
seltab-selname = 'ZSECT'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-W_TC.
APPEND seltab.
IF W_CDAT = 1.
W_CDAT = 0.
seltab-selname = 'ZCERTNO'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-CTNUMBER.
APPEND seltab.
ELSEIF W_CDAT = 2.
* W_CDAT = 0.
* seltab-selname = 'ZCERT'.
* seltab-kind = 'S'.
* seltab-sign = 'I'.
* seltab-option = 'EQ'.
* seltab-low = XFINAL-CTNUMBER.
* APPEND seltab.
ENDIF.
* CLEAR W_CDAT.
* W_CDAT = .
seltab-selname = 'ZCERDT'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-J_1ICERTDT."W_CDAT.
APPEND seltab.
ENDFORM. "POP_TAB
FORM POP_TAB2.
REFRESH SELTAB.
CLEAR SELTAB.
seltab-selname = 'ZBUKRS'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-bukrs.
APPEND seltab.
seltab-selname = 'ZYEAR'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-GJAHR.
APPEND seltab.
seltab-selname = 'ZSECCO'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-SECCO.
APPEND seltab.
seltab-selname = 'ZSECT'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-W_TC.
APPEND seltab.
seltab-selname = 'ZCHALL'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-J_1IEXTCHLN.
APPEND seltab.
seltab-selname = 'ZCHDT'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-J_1IEXTCHDT.
APPEND seltab.
seltab-selname = 'ZVENDOR'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-WT_ACCO.
APPEND seltab.
ENDFORM. "POP_TAB
FORM POP_TAB_U.
REFRESH SELTAB.
CLEAR SELTAB.
seltab-selname = 'ZBUKRS'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-bukrs.
APPEND seltab.
seltab-selname = 'ZYEAR'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-A_GJAHR.
APPEND seltab.
seltab-selname = 'ZBELNR'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-A_BELNR.
APPEND seltab.
seltab-selname = 'ZCHALLAN'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-J_1IINTCHLN.
APPEND seltab.
seltab-selname = 'ZCHALLDT'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-J_1IINTCHDT.
APPEND seltab.
ENDFORM.
FORM POP_TAB_R.
REFRESH SELTAB.
CLEAR SELTAB.
seltab-selname = 'AUGBL'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-A_BELNR.
APPEND seltab.
seltab-selname = 'BUKRS'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-BUKRS.
APPEND seltab.
seltab-selname = 'GJAHR'.
seltab-kind = 'S'.
seltab-sign = 'I'.
seltab-option = 'EQ'.
seltab-low = XFINAL-GJAHR.
APPEND seltab.
ENDFORM.
No comments:
Post a Comment