0% found this document useful (0 votes)
33 views2 pages

Code

ABAP code

Uploaded by

mayur.bhor2025
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views2 pages

Code

ABAP code

Uploaded by

mayur.bhor2025
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

315

IF gt_sdinv[] IS NOT INITIAL.


SELECT * FROM i_billingdocumentitem
FOR ALL ENTRIES IN @gt_sdinv
WHERE billingdocument = @gt_sdinv-billingdocument
AND billingdocumenttype IN @rg_sddct
* AND creationdate = @docno-postingdate
* AND companycode = @docno-companycode
AND billingquantity GT 0
INTO TABLE @DATA(gt_sdinv1).
ENDIF.
IF gt_sdinv1[] IS NOT INITIAL.
SELECT * FROM i_billingdocitemprcgelmntbasic
FOR ALL ENTRIES IN @gt_sdinv1
WHERE billingdocument = @gt_sdinv1-billingdocument
AND billingdocumentitem = @gt_sdinv1-billingdocumentitem
AND conditiontype IN @rg_sdcnd
AND conditioninactivereason = ''
INTO TABLE @DATA(gt_konv).

SELECT * FROM i_custsalesareatax


FOR ALL ENTRIES IN @gt_sdinv1
WHERE customer = @gt_sdinv1-soldtoparty
AND customertaxcategory IN ( 'JOCG', 'JOSG', 'JOIG' )
INTO TABLE @DATA(gt_knv1).
SELECT * FROM i_salesdocumentitempartner
FOR ALL ENTRIES IN @gt_sdinv1
WHERE salesdocument = @gt_sdinv1-billingdocument
AND partnerfunction IN ( 'RE', 'WE' )
INTO TABLE @DATA(gt_vbpa).
SELECT subsqntdocitmprecdgdocument, subsqntdocitmprecdgdocitem,
subsqntdocitmprecdgdoccategory,
subsequentdocument, subsequentdocumentitem, subsequentdocumentcategory
FROM i_salesdocitmsubsqntprocflow
FOR ALL ENTRIES IN @gt_sdinv1
WHERE salesdocument = @gt_sdinv1-billingdocument
AND subsequentdocumentcategory IN ( 'O', 'P' )
AND subsqntdocitmprecdgdoccategory = 'M'
INTO TABLE @DATA(gt_vbfa).
IF gt_vbfa IS NOT INITIAL.
SELECT billingdocument, billingdocumentdate, documentreferenceid
FROM i_billingdocument
FOR ALL ENTRIES IN @gt_vbfa
WHERE billingdocument = @gt_vbfa-subsqntdocitmprecdgdocument
INTO TABLE @DATA(gt_vbrk).
ENDIF.
SELECT * FROM zirn_unit_mapng
FOR ALL ENTRIES IN @gt_sdinv1
WHERE vrkme_i = @gt_sdinv1-baseunit
INTO TABLE @DATA(gt_irun).

SELECT customer, county, organizationbpname1, organizationbpname2, cityname,


postalcode,
region, streetname, addressid, districtname, taxnumber3
FROM i_customer
FOR ALL ENTRIES IN @gt_sdinv1
WHERE customer = @gt_sdinv1-soldtoparty
INTO TABLE @DATA(gt_kna1).
IF gt_vbpa IS NOT INITIAL.
SELECT customer, county, organizationbpname1, organizationbpname2,
cityname, postalcode,
region, streetname, addressid, districtname, taxnumber3
FROM i_customer
FOR ALL ENTRIES IN @gt_vbpa
WHERE customer = @gt_vbpa-customer
APPENDING TABLE @gt_kna1.

SORT: gt_kna1.
DELETE ADJACENT DUPLICATES FROM gt_kna1.
ENDIF.

SELECT * FROM i_companycode


FOR ALL ENTRIES IN @gt_sdinv1
WHERE companycode = @gt_sdinv1-companycode
INTO TABLE @DATA(gt_t001).
IF gt_t001 IS NOT INITIAL.
SELECT * FROM i_address_2
FOR ALL ENTRIES IN @gt_t001
WHERE addressid = @gt_t001-addressid
INTO TABLE @DATA(gt_adrc).
ENDIF.

SELECT * FROM i_plant


FOR ALL ENTRIES IN @gt_sdinv1
WHERE plant = @gt_sdinv1-plant
INTO TABLE @DATA(gt_t001w).
IF gt_t001w IS NOT INITIAL.
SELECT * FROM i_address_2
FOR ALL ENTRIES IN @gt_t001w
WHERE addressid = @gt_t001w-addressid
APPENDING TABLE @gt_adrc.
ENDIF.
IF gt_kna1 IS NOT INITIAL.
SELECT * FROM i_address_2
FOR ALL ENTRIES IN @gt_kna1
WHERE addressid = @gt_kna1-addressid
APPENDING TABLE @gt_adrc.
ENDIF.
SELECT product, plant, consumptiontaxctrlcode FROM i_productplantbasic
FOR ALL ENTRIES IN @gt_sdinv1
WHERE product = @gt_sdinv1-material
AND plant = @gt_sdinv1-plant
INTO TABLE @DATA(gt_marc).
ENDIF.
IF gt_adrc IS NOT INITIAL.
SELECT * FROM I_WORKPLACEADDRESS
FOR ALL ENTRIES IN @gt_adrc
WHERE addressid = @gt_adrc-addressid
INTO TABLE @DATA(gt_adr6).
ENDIF.
if gt_sdinv1 is INITIAL.
loop at gt_Sel INTO ls_Sel.
* select * from ZIRN_FM_EXPORT into @data(test).
ENDLOOP.
endif.
427-428

You might also like