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

Automatic GR while PGI

RahulKeshav
Active Contributor
0 Likes
1,002

Hi All,

I am trying to Post GR at PGI.

I am using Badi DELIVERY_PUBLISH~PUBLISH_AFTER_SAVE for writin gthe code.

There i am calling BAPI - BAPI_GOODSMVT_CREATE for movement type 101.

But i am getting a dump for as Delivery does not exist.

System is successfully create the std Mat.doc for PGI but while creating Mat.doc. from my code it is throwing a dump.

PLease suggest.

Thnx

RK

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
816

Hi RK,

Is the error coming at creation of delivery or in change delivery mode? If it is at creation then in DELIVERY_PUBLISH~PUBLISH_AFTER_SAVE you will get the delivery number but it will not be commited to database

at this time hence BAPI_GOODSMVT_CREATE wii give error as the delivery does not exist.

To overcome this you can bundle your entire code written in for Posting GR in a function odule and then call this FM in background task in the BADI.Please refer syntax of calling FM in background task if you are not aware of it.

And dont forget to make this FM as Remote Enabled in FM properties

Thanks,

Pawan Gore

4 REPLIES 4
Read only

Former Member
0 Likes
817

Hi RK,

Is the error coming at creation of delivery or in change delivery mode? If it is at creation then in DELIVERY_PUBLISH~PUBLISH_AFTER_SAVE you will get the delivery number but it will not be commited to database

at this time hence BAPI_GOODSMVT_CREATE wii give error as the delivery does not exist.

To overcome this you can bundle your entire code written in for Posting GR in a function odule and then call this FM in background task in the BADI.Please refer syntax of calling FM in background task if you are not aware of it.

And dont forget to make this FM as Remote Enabled in FM properties

Thanks,

Pawan Gore

Read only

0 Likes
816

PG,

I am doing PGI from VL02n.

Read only

0 Likes
816

It is not working......

System is giving dump....as


Short text
    The current application triggered a termination with a short dump.

Short text of error message:
Delivery   does not exist

Long text of error message:
 Diagnosis
     The delivery you specified does not exist.
     This document may have been archived.
 Procedure
     Check the delivery number you entered.
     If the delivery has only just been added, it is possible that it
     has not yet been posted. If this is the case, repeat the
     transaction again later. If the error message still appears, inform
     your programming team or system administrator.

I tried with Background..but code didnt work...couldnt debug as background process...

Please suggest .....

Read only

0 Likes
816

Hi All,

Finally it is working.

As suggested by Pawan, I wrote all the code in a ZFM

then i called my ZFM in the same badi DELIVERY_PUBLISH in method PUBLISH_AFTER_SAVE.

Thats it.........

Thanks Pankaj and all for there useful reply.

RK.

Edited by: Rahul Keshav on Sep 21, 2011 6:30 PM