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

problem in field selection from VBPA

Former Member
0 Likes
2,915

hello friends ,

this is the structure of my table.

BEGIN OF IT_FINAL OCCURS 0,

VBELN LIKE VBAK-VBELN,

AUART LIKE VBAK-AUART,

VKGRP LIKE VBAK-VKGRP,

NETWR LIKE VBAK-NETWR,

KDGRP LIKE VBKD-KDGRP,

PERNR LIKE VBPA-PERNR,

END OF IT_FINAL.

there are similar values in the field of vbpa-vbeln. e.g.there are 6 entries in the vbap -vbeln field for 0000004969. and some of these value contains null value for vbpa-pernr.so i'm getting null value in the it_final for pernr as it will select only one value from vbpa-vbeln.

and also as i debug i'm getting the right value in vbak-auart ie. TA.

but while writing im getting OR for vbak-auart.similarly while debugging i'm getting the value for vbak-netwr.but while displaying nothing appears in the display screen.

dis is my queries.........

SELECT * FROM VBAK INTO CORRESPONDING FIELDS OF TABLE IT_VBAK

WHERE VBELN IN DN.

SELECT * FROM VBKD INTO CORRESPONDING FIELDS OF TABLE IT_VBKD FOR ALL ENTRIES IN IT_VBAK

WHERE VBELN = IT_VBAK-VBELN.

SELECT distinct * FROM VBPA INTO CORRESPONDING FIELDS OF TABLE IT_VBPA FOR ALL ENTRIES IN IT_VBAK

WHERE VBELN = IT_VBAK-VBELN.

plz help y dis is so?

thnks n regards,

mukesh

1 ACCEPTED SOLUTION
Read only

GuyF
Active Participant
0 Likes
2,317

Hi,

VBPA is a table containing all the partners relevant to your order. You need to specify the partner type, which is field PARVW. For example, the Ship-to partner is WE, and the Sold-to partner is AG.

Look at the data you have, and select the relevant partner you need.

For example, if your partner is AM, your select will be like this:

SELECT * FROM VBPA INTO CORRESPONDING FIELDS OF TABLE IT_VBPA FOR ALL ENTRIES IN IT_VBAK
WHERE VBELN = IT_VBAK-VBELN
AND PARVW = 'AM'.

Guy.

7 REPLIES 7
Read only

Former Member
0 Likes
2,317

Before fetching records form vbkd ,,

Just check whether vbak is initial or not..

If vbak is not initial.

Here u have to write the select statement for vbkd.

endif..

Jus try with this.

Hope it Helps.

Read only

Former Member
0 Likes
2,317

Hi,

You are retrieving data from the it_vbkd. Before that check whether it_VBAK is initial or not.

if it_vbak is not initial.

select data from VBKD.

endif.

Regards,

Jyothi CH.

Read only

0 Likes
2,317

NO IT'S NOT WORKING .........

PLZ HELP.

Read only

GuyF
Active Participant
0 Likes
2,317

You need to look at your VBPA table in SE16 and see what the value in PARVW for the partner you need, and then use that data instead of AM. I just gave that one as an example.

Guy.

Read only

0 Likes
2,317

What you are looking from VBPA table ?

VBPA table have all the partner details for the given sales order. Based on the partner function (AG,RE,RG and WE ) the pernr, adrnr will be stored in the respective field, If you want to get the details for the particular partenr give partner type also in the query

Regards

Sasi

Read only

GuyF
Active Participant
0 Likes
2,318

Hi,

VBPA is a table containing all the partners relevant to your order. You need to specify the partner type, which is field PARVW. For example, the Ship-to partner is WE, and the Sold-to partner is AG.

Look at the data you have, and select the relevant partner you need.

For example, if your partner is AM, your select will be like this:

SELECT * FROM VBPA INTO CORRESPONDING FIELDS OF TABLE IT_VBPA FOR ALL ENTRIES IN IT_VBAK
WHERE VBELN = IT_VBAK-VBELN
AND PARVW = 'AM'.

Guy.

Read only

Former Member
0 Likes
2,317

YES SIR....THNKU

nw i'm getting the values in pernr.....

after the write statments AUART colomn turns into OR instead of AT. and NETWR is blank after write statement even thogh i'm getting the values and KDGRP fields meregs with NETWR values and shows the combined value in KDGRP COLUMN......

THNK U