cancel
Showing results for 
Search instead for 
Did you mean: 

Populating Customer Code in Assignment Field

Former Member
0 Kudos

Hi SAP Gurus,

   We are having a scenario in which we want to populate Customer Code in Assignment Field for one single GL Code in Billing Document.

    For example,  When the user saves the biliing document in Transaction code VF01 or VF02, then in the accounting document which was created will be

                               Posting key     Account                      Amount                         Assignment             

                                   01            Customer   (AB)   Dr.        1000 

                                   50            Sales                    Cr.        1000

                                   40            Rebtes                 Dr.         900

                                   50            Rebates Acc        Cr.         900                                 AB

                          

    

Now It should populate Customer Code which is AB in the above example in the assignment field of Rebate Accrual GL Code only.I have already maintained Sort Key as Customer Number in GL Master  of Rebate Accrual.But still it was showing blank.

Can anybody help me with the substitution to be written .

Thanks in Advance

Regards

Nikhil

View Entire Topic
jaybanda2
Active Participant
0 Kudos

If your Customer code= AB Always then you can go with this.

under Tcode GGB1 >> FInancial Accounting>> Line item

1) click on the Substitution Create icon and create your Substitution as VF02 and some description (Substitution for Billing/FI invoice)

2) now on that new substitution you created. highlight or place your cursor and click on the Step and give some description and select BSEG- ZUONR, then select CONSTANT VALUE.

3) under your step >> go to  prerequisite - it will show you the Tables. double click on BSEG Table and form the list choose BSEG- HKONT to the prerequisite area  and Click "=" and Constant and enter your GL Rebates acc- 1234567

i.e in Prerequisite it should be: BSEG-HKONT = '1234567'

4) click on Substitutions under the Prerequisite.

and in the constant value Field enter AB. and save the Substitution.

AND IF YOUR Customer Code is not always AB, if you have no of customer codes. then in step 2 select UserExit, instead of constant value.

and in the userexit ABAP person has to put a logic, to get the Customer code dynamically against the GLacc.

hope this helps

Regards

Jay

Message was edited by: jay banda and dont forget to activate it in GGB4.

Former Member
0 Kudos

Hi Jay,

Thanks for the reply.

  I have tried with prerequisite BSEG-HKONT= GL Code and Substitution BSEG-ZUONR= AB(Customer Code) ,But it has not substituted at the time of posting Billing document in VF01.

I have also activated it in GGB4.

Please also tell me the user exit to be used for this.

Regards

Nikhil

jaybanda2
Active Participant
0 Kudos

Hi Nikhil,

the substitution didnt work because we are doing it at FI document level table BSEG. check if the same is available at VBRK table level under Sales and Distribution. and even user exit talk to your ABAP team ya, they can figure out where/whihc user exit to include in case you guys have to use user exit.

Jay