2024 Nov 21 9:07 AM - edited 2024 Nov 21 9:07 AM
Hi Experts,
I have am issue in fetching the data from ADRC Table. Please find the details below :
I have written a custom enhancement where I am triggering an Idoc whenever a PR is Created in SAP using the BADI ME_REQ_POSTED. And I am using the Idoc type PREQCR1 to populate the Idoc. The Issue I am facing here is populating the Idoc Address Segments.
Whenever there is a address change in PR, that address is getting saved into ADRC after this Idoc has been triggered because of a COMMIT WORK was placed later in the Standard Code. This standard code is currently available after this BADI ME_REQ_POSTED. So, the address segments in the Idoc is not getting populated with the latest Address.
How can I counter this Issue. Help greatly appreciated.
Thanks and Regards.
Request clarification before answering.
If not yet saved to database, the address should be available in memory of function group SZA0, did you alread try to
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First step is to find the correct location of those data in Function Group, did you perform it, e.g. debug ?
Only if succesful, then start coding
FIELD-SYMBOLS: <xadrc> TYPE adrc_tab.
ASSIGN ('(SAPLSZA0)XADRC') TO <xadrc>.
Hi Raymond, I encountered a New Issue when copying address for multiple line item PRs.
Suppose, there are 3 line items for PR and these 3 line items have different address, in the Idoc, only the address data of the 3rd line item is getting copied for all 3 line items. This might be because, the 3rd line items is edited and saved at last. Any solution for this one ?
I am reading all the 3 line items in a loop to populate the Idoc segments.
ASSIGN ('(SAPLSZA0)XADRC') TO <xadrc>.
CHECK <xadrc> IS ASSIGNED.
MOVE-CORRESPONDING <xadrc> TO ls_adrc.
Raymond, this is the code I am using to populate the Idoc Segments. I am filling the Idoc segments from ls_adrc which is a structure.
I did not get the point where you said <xadrc> is an internal table. Could you pleas explain ?
Look in top include of function group (in a sub-include)
* declaration of the table with the new content:ADRC
DATA: BEGIN OF xadrc OCCURS 20.
INCLUDE STRUCTURE vadrc .
DATA: END OF xadrc .
So try to assign XADRC[] and then use LOOP or READ TABLE, else you may be assigning and reading the HEADER LINE
User | Count |
---|---|
85 | |
12 | |
9 | |
8 | |
8 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.