on 09-07-2017 7:18 PM
I would like to reference the source Purchase Order in a new Purchase Order created by adoption.
Sequence of steps:
1) In ME21N, I activate [Document Overview On]
2) run the selection for Purchase Orders.
3) Select the line items I want in the new PO and press the [Adopt] button.
4) A new PO is created.
I would like to make a reference in this new document to the source document. I will probably use a BADI at header or item level in the PO.
In this scenario, how may I find a reference to the "source document" in ABAP code?
Yes, Thank you. That is what I was looking for.
The following code will get this reference in any code in the MEPO library code area, including transactions, badis, and exits:
DATA: ref TYPE string.
FIELD-SYMBOLS: <rekko> TYPE ekko.
ref = '(SAPLMEPO)REKKO'. "REKKO (EKKO aus Referenz)
ASSIGN: (ref) TO <rekko>.
IF <rekko> IS ASSIGNED.
IF <rekko>-ebeln IS NOT INITIAL.
* <rekko>-ebeln "<== is the reference Purchase Order from which this PO was ADOPTed.
ENDIF.
ENDIF.
UNASSIGN: <rekko>.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
8 | |
6 | |
5 | |
5 | |
4 | |
3 | |
2 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.