Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

invoice line items

Former Member
0 Likes
993

hi all,

iam getting sales document number from vbak on the basis of it iam getting invoice number from vbfa.now i want to get header data from vbrk & lineitem data from vbrp.

tables:vbak.

types: begin of it1,

vbeln type vbak-vbeln,

vkbur type vbak-vkbur,

zinv type vbfa-vbeln,

*----


netwr type vbrk-netwr,

fkdat type vbrk-fkdat,

arktx type vbrp-arktx,

fkimg type vbrp-fkimg,

znetwr type vbrp-netwr,

matnr type vbrp-matnr,

vbtyp_n type vbfa-vbtyp_n,

posnr type vbrp-posnr,

*----


vrkme type vbrp-vrkme,

zcount type i,

end of it1.

data: itab type standard table of it1 with header line.

data:itab2 type standard table of it1 with header line.

data: v11 type vbak-vbeln,

v12 type vbak-vkbur,

v10 type vbfa-vbeln,

v13 type vbfa-vbtyp_n.

data l_tabix type sy-tabix.

parameters : zkunnr type vbak-kunnr,

vkbur type vbak-vkbur.

*----


DATA: v1 type vbrk-netwr,

v2 type vbrk-fkdat,

v3 type vbrp-arktx,

v4 type vbrp-matnr,

v5 type vbrp-fkimg,

v6 TYPE vbrp-netwr,

V7 TYPE VBRP-POSNR,

v8 type vbrp-vrkme.

data vposnr type vbrp-posnr.

data count type i.

select vbeln vkbur from vbak into corresponding fields of table itab where kunnr = zkunnr.

append itab.

loop at itab .

l_tabix = sy-tabix.

select vbeln vbtyp_n into (v10 ,v13) from vbfa where vbelv = itab-vbeln and vbtyp_n = 'M'.

itab-zinv = v10.

itab-vbtyp_n = v13.

modify itab index l_tabix.

ENDSELECT.

endloop.

loop at itab.

delete itab where vbtyp_n <> 'M'.

endloop.

I have the invoice number & the sales document number in itab ,for every invoice number i need the header data from vbrk & item data from vbrp in itab can anyone tell me how to achieve this?

rgds.

points wuld be awarded.

hi all,

iam getting sales document number from vbak on the basis of it iam getting invoice number from vbfa.now i want to get header data from vbrk & lineitem data from vbrp.

tables:vbak.

types: begin of it1,

vbeln type vbak-vbeln,

vkbur type vbak-vkbur,

zinv type vbfa-vbeln,

*----


netwr type vbrk-netwr,

fkdat type vbrk-fkdat,

arktx type vbrp-arktx,

fkimg type vbrp-fkimg,

znetwr type vbrp-netwr,

matnr type vbrp-matnr,

vbtyp_n type vbfa-vbtyp_n,

posnr type vbrp-posnr,

*----


vrkme type vbrp-vrkme,

zcount type i,

end of it1.

data: itab type standard table of it1 with header line.

data:itab2 type standard table of it1 with header line.

data: v11 type vbak-vbeln,

v12 type vbak-vkbur,

v10 type vbfa-vbeln,

v13 type vbfa-vbtyp_n.

data l_tabix type sy-tabix.

parameters : zkunnr type vbak-kunnr,

vkbur type vbak-vkbur.

*----


DATA: v1 type vbrk-netwr,

v2 type vbrk-fkdat,

v3 type vbrp-arktx,

v4 type vbrp-matnr,

v5 type vbrp-fkimg,

v6 TYPE vbrp-netwr,

V7 TYPE VBRP-POSNR,

v8 type vbrp-vrkme.

data vposnr type vbrp-posnr.

data count type i.

select vbeln vkbur from vbak into corresponding fields of table itab where kunnr = zkunnr.

append itab.

loop at itab .

l_tabix = sy-tabix.

select vbeln vbtyp_n into (v10 ,v13) from vbfa where vbelv = itab-vbeln and vbtyp_n = 'M'.

itab-zinv = v10.

itab-vbtyp_n = v13.

modify itab index l_tabix.

ENDSELECT.

endloop.

loop at itab.

delete itab where vbtyp_n <> 'M'.

endloop.

I have the invoice number & the sales document number in itab ,for every invoice number i need the header data from vbrk & item data from vbrp in itab can anyone tell me how to achieve this?

rgds.

points wuld be awarded.

2 REPLIES 2
Read only

Former Member
0 Likes
648

hi,

You can pass VBELN form VBFA to VBELN of VBRK and get the required data from VBRK, after that pass VBELN of VBRK to VBELN of VBRP and get the required line item data.

Hope thihs solve your problem.,

Regards,

Bharat.

      • Reward points if helpful.

Read only

Former Member
0 Likes
648

select vbrk-(required fields) vbrp-(required fields)

FROM vbrp INNER JOIN vbrk

ON vbrpvbeln = vbrkvbeln

INTO CORRESPONDING FIELDS OF TABLE itab

for all entries in it_vbfa

WHERE vbrk~vbeln = it_vbfa-billing doc no.