Application Development 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: 

Modify an order when created by sales order - How to do it ?

Former Member
0 Kudos

Hello,

for some material, the sales order(va02) create an order(iw32).

I would modify this order (the header text) at the creation moment .

I opened some exit when the sales order is saved, but at this time the order have number (percent)000000000001 (provisory), so if I would use a bapi to change it, I don't know the final number .

Some idea ??

tks.

R.

1 ACCEPTED SOLUTION

former_member353207
Participant
0 Kudos

You can use the enhancement

PPCO0001

EXIT_SAPLCOBT_001

ZXCO1U01

Here you get the final order-number.

But you can't change any data. But you could use the the BAPI "BAPI_PRODORD_CHANGE" do this in background task.

regards

Joerg

8 REPLIES 8

former_member353207
Participant
0 Kudos

You can use the enhancement

PPCO0001

EXIT_SAPLCOBT_001

ZXCO1U01

Here you get the final order-number.

But you can't change any data. But you could use the the BAPI "BAPI_PRODORD_CHANGE" do this in background task.

regards

Joerg

0 Kudos

Hello

tks for your reply, is very very useful but not solve my problem because I have to read the standard text at item level of sales order and copy it on order.

unfortunately In you exit this text is not available.

any idea ?

0 Kudos

Export the text in the sales order exit and import it back when you change the production order?

0 Kudos

do you mean export in memory ??

tks.

0 Kudos

You'll find the sales order number/ pos. in the export-table "Header_table" of EXIT_SAPLCOBT_001.

(Fields: KDAUF_AUFK + KDPOS_AUFK).

SELECT single arktx FROM vbap into lv_arktx

WHERE vbeln = Header_table-KDAUF_AUFK

AND posnr = Header_table-KDPOS_AUFK.

Joerg

0 Kudos

Hello Joerg,

tks for reply but I need the long text: (NOT STILL SAVED ON THE SYSTEM)

is a standard text SO10 - with

CLIENT 030

ID 0001

LANGUAGE EN

NAME HEAD+ITEM

OBJECT VBBP

TKS.

Maybe there's some place where is buffered os saved temporarly ?

tks.

0 Kudos

>

> do you mean export in memory ??

>

>

> tks.

yup. something like that.

0 Kudos

Ok Roberto

try this:

Do 1000 times.

CALL FUNCTION 'ENQUEUE_EVVBAKE' "Wait until Salesorder is saved"

EXPORTING

vbeln = lv_vbeln

EXCEPTIONS

foreign_lock = 1

system_failure = 2

OTHERS = 3.

IF sy-subrc EQ 0.

CALL FUNCTION 'DEQUEUE_ALL'.

exit.

else.

WAIT UP TO 1 SECONDS.

endif.

enddo.

  • Then try to read the text.

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = ....

  • and save it.

CALL FUNCTION 'SAVE_TEXT'

...

  • if it is not working, use a Z-table, fill it with vbeln, posnr

  • and write a program for your requirement and plan a job with sm37.

reagrds Joerg