Substitutions

0 pts.
Tags:
ABAP
mySAP Financials
SAP development
Hi Guys, I have a document generated by the system; the line item (in this case line item 2) does not contain reference to the vendor number (4000150). However line item 3 does. Item Vendor G/L Acc Account Assignment 1 - 133143 20050628 2 - 27600 20050628 3 4000150 4000150 20050628 4 - 15400 20050628 I want to create user exit that will check all line items for the existence of a value in the vendor number field, and if one is found (e.g. on line 3) it should be copied to the assignment field of the line item posting to G/L account 276000(Line 2). The prerequisite set up as part of the FI substitution, will ensure that the user exit is called when a posting to account 276000 is done. How can I do this? My current substitution works if the line above G/L account 276000 has a vendor number. What is the solution? TM
ASKED: July 6, 2005  8:43 AM
UPDATED: July 8, 2005  11:28 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Since you want to take a value from one line item and place it on another line item, you’ll need a substitution for callup point 3 — which uses the whole FI document. This will allow you to loop through all the line items, capturing the vendor number from the relevant line item and adding it to the line item 2. We used similar logic to populate the business area field – see our sample logic below. You’ll need to change the logic up a bit in order to populate the vendor on line item 2, but this code should give you an idea of how to manipulate the data within your substitution userexit.

One thing to note: At callup point 3, no BSEG field has currently been released for substitution, since substitution is not possible for all transactions by means of which documents are posted. Refer to OSS Note 42615 for more information – if you choose to substitute BSEG fields, you’ll need to follow the instructions in this OSS note to update the GB01 table. I’ve done this for several clients, so please let me know if you have any questions.

Also, if you switch over to using a callup point 3 substitution, you’ll need to remove your account prerequisite and just handle all checks and validations within your userexit logic.

Sample userexit code:
————————
form u900 changing bool_data type gb002_015.

data: hold_gsber like bseg-gsber.
clear hold_gsber.

* Check all line item business areas. Keep the first
* business area found, for use on the discount line item.

loop at bool_data-bseg into bseg.
if not bseg-gsber is initial and
hold_gsber is initial.
move bseg-gsber to hold_gsber.
endif.
if bseg-gsber is initial.
move hold_gsber to bseg-gsber.
modify bool_data-bseg index sy-tabix from bseg.
endif.
endloop.

endform. “U900

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following