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

posting goods issue

Former Member
0 Likes
1,944

Hi all!

my Z program has to pass delivery number to RV_INVOICE_CREATE in order to create debit / credit memo invoice, but before retrieving delivery number, post goods issue must have been done. Any ideas?

Reminding - sequency is like this:

1 Order 2 Delivery 3 Billing

Will award points.

Kind regards,

Mindaugas

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,849

Use FM for post goods issue WS_DELIVERY_UPDATE

Hi all!

my Z program has to pass delivery number to RV_INVOICE_CREATE in order to create debit / credit memo invoice, but before retrieving delivery number, post goods issue must have been done. Any ideas?

Reminding - sequency is like this:

1 Order 2 Delivery 3 Billing

Will award points.

Kind regards,

Mindaugas

10 REPLIES 10
Read only

Former Member
0 Likes
1,849

Hi,

I worked on similar issue earlier, just try whether my solution will work for you or not ..

1) First check the table 'SHP_IDX_GDSI', to findout whether the PGI done for the delivery or not, The table SHP_IDX_GDSI will store all the deliveries for whose PGI not done.

2) If you are sure that PGI is not done for the delivery then, you can use the below logic, when order quantity is confirmed.

DATA: l_kostk TYPE vbuk-kostk."Picking

*If order quantity is picked completely

*Check the status of picking

SELECT SINGLE kostk FROM vbuk

INTO l_kostk

WHERE vbeln = w_del.

if l_kostk = c_charC.

f_flag2 = c_charx.

else.

clear f_flag2.

endif.

READ TABLE i_idoc_data WITH KEY segnam = c_e1edl18 INTO wa_idoc_data.

IF sy-subrc = 0.

MOVE wa_idoc_data-sdata TO wa_e1edl18.

  • If its completely delivered

IF f_flag2 = c_charx.

  • change the qulifier to PGI

wa_e1edl18-qualf = 'PGI'.

else.

clear wa_e1edl18-qualf.

endif.

MOVE wa_e1edl18 TO wa_idoc_data-sdata.

MODIFY i_idoc_data FROM wa_idoc_data

TRANSPORTING sdata WHERE segnam = c_e1edl18.

ENDIF.

CALL FUNCTION 'IDOC_INPUT_DELVRY'

EXPORTING

input_method = w_in_method

mass_processing = w_mass

TABLES

idoc_contrl = idoc_contrl

idoc_data = i_idoc_data

idoc_status = idoc_status

return_variables = return_variables

serialization_info = serialization_info.

Regards,

Donepudi.

Reward, if its helpful.

Read only

Former Member
0 Likes
1,850

Use FM for post goods issue WS_DELIVERY_UPDATE

Read only

0 Likes
1,849

Thanks Seshu.

A few things still not clear: for example, I have orders in VBAK and deliveries in LIKP... what is the first step for posting goods issue? What info I must have before this step?

Probably at first I need to retrieve order and after to do PGI and after PGI to retrieve delivery nr and to create invoice?

BR, M.

Read only

0 Likes
1,849

First step is create sales order ( if you have sales order ) ,get the sales order from vbak,then create delivery then post goods issue,then billing document ?

what is your requirement ? do you want create complete cycle ..

Sales order -> Delivery ->post goods issue -> Billing document

Just let me know ,so that i will send you the complete Function module to all.

Thanks

Seshu

Read only

0 Likes
1,849

My case is this: XI is reading Excel file with info about orders: customer nr, material nr, invoiced price and so on.

As well XI creates orders with info from Excel file and my Z program has to create credit / debit memo invoices from those orders...

The sequence is ok:

Sales order -> Delivery ->post goods issue -> Billing document

So Z program has to take Sales order and to create Delivery, after to post goods issue and to create billing doc. If so, what is the key to take the order from VBAK ? I mean how program knows that current order was not proceeded before?

BR, M.

Read only

0 Likes
1,849

Just take sales order from vbak and pass ur sales order number to Delivery Function Module..

VBAK-VBELN ( sales order Number)

VBAP-VSTEL ( Shiiping point)

Date - give ur sy-datum to ur delivery Function Module

then pass delivery number to fm(Post goods issue ) then create Invoice ( RV_INVOICE_CREATE).

Read only

0 Likes
1,849

oki clear, thanks.

One more thing - let's say there are new orders in VBAK and if I run my program it will create invoices for all orders in VBAK... how to recognize that some orders are new and some are invoiced already (to skip invoiced orders)?

BR, M.

Read only

0 Likes
1,849

check with vbfa table ,give ur sales order ,it will giv you delivery number and also invoice nuber.

if it is available then do not proceed ..

Read only

0 Likes
1,849

Delivery Function Module.... is it standart FM..?

BR, M.

Read only

0 Likes
1,849

use RV_DELIVERY_CREATE to create delivery or search bapi FM 'bapidelvcre*