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

Determine Reverse Good Movement

Former Member
0 Likes
1,190

Dear all,

Where can we determine an outbound delivery has reversed or not? Which table and field?

Help me pls,

Thanks,

Quanglv,

Dear all,

Where can we determine an outbound delivery has reversed or not? Which table and field?

Help me pls,

Thanks,

Quanglv,

4 REPLIES 4
Read only

Former Member
0 Likes
1,010

Check the table VBFA,

where VBELV = <delivery Number> 
and VBTYP_V = 'J' 
and  VBTYP_N = 'h'

If any records exist in VBFA with above WHERE condition, then the delivery is reversed with the Reverse document number VBFA-VBELN.

Read only

0 Likes
1,010

Hi Vinod Kumar,

Thanks for your suggestion. But it's difficult if there are multi PGI and reversal PGI document.

Is there any flag determine that?

Thanks,

Read only

0 Likes
1,010

I don't think there is any flag to identify the state of delivery (PGI Created or Reversed). In the scenario mentioned by you, compare the number of entries in VBFA related to

where VBELV = <Delivery Number> 
and  VBTYP_V = 'J'
and  VBTYP_N = 'R'

and

where VBELV = <Delivery Number> 
and  VBTYP_V = 'J'
and  VBTYP_N = 'h'

if the count of records in 1st and 2nd are same( and > 0) , PGI is created & Cancelled. Otherwise (count of 1 > count of 2), PGI is not reveresed.

Hope this logic will be helpful for your requirement.

Read only

Former Member
0 Likes
1,010

Hi

The fields SJAHR, SMBLN and SMBLP of MSEG return the key of the item reversed, so if the document A it means you need to select a record frim MSEG having the fields above with the key of A:

 SELECT * FROM MSEG WHERE  SJAHR = <A>-MJAHR
                                           AND SMBLN = <A>-MBLNR

So that means you need to check all items of A were reversed

Max