Skip to Content

25 Comments

You must be Logged on to comment or reply to a post.

  1. Kaushal Sharma

    Hi,

    It is really a good document.

    Is it possible to have different GL for PGI for the same material based on Reason for sales order by using this user exit?

    It
    (0) 
    1. Dibyendu Patra Post author

      Well, WRX transaction key is not searched by system at the time of PGI.

      System posts just Stock account (BSX) Credit and COGS account (GBB-VAX) Debit.

      So, this enhancement will not work in this case. As I have explained you can’t use account modifier for BSX transaction event key, but you can use the account modifier for the transaction event key GBB. If you want to use different G/L account (for transaction key GBB) for PGI, then you can do it by using different movement type. Check my document Different accounting for different purpose against movement type

      (0) 
      1. Joao Sousa

        it’s a common requirement but the standard doesnt allow that, since the schedule line of the SD document can’t be determined based on the order reason (and the schedule line determines the movement type).

        Maybe someone can make a blog with the customer determination of the schedule line in SD 🙂

        (0) 
  2. Joao Sousa

    You need to create this include program from SE38 (tell your ABAPer to do the same).

    If you are telling the ABAPer the code he has to write, why don’t you write it yourself? Do you have SE38phobia or something like that?

    Sorry if I come on too strong but this dogmatic separation between functional and ABAPers (which I’ve seen in a lot of places), when functional can write the code, makes my head go bonkers.ABAP is (still) a statement based language so the syntax is very simple.

    If you can’t write code, don’t try. If you can write code, and it’s something very simple (like this), do it yourself instead of bothering another person who is busy doing something you can’t do. If I had to call an ABAPer each time I needed 5 lines of code done, I would’ve quit SAP by now.

    (0) 
    1. Dibyendu Patra Post author

      Come on.. That just a simple sentence.. Do not need to hyper about it.. 🙂 If a functional consultant can write the code then of course he doesn’t need technical person.

      (0) 
      1. Joao Sousa

        It pains me whenever I see this SAP idiosyncrasy be propagated. It really hits a nerve. Sometimes it appears as if programming is somehow lesser work that the “brain trust” shouldn’t touch, even if it takes 10 minutes and they can do it.

        Something that eventually leads good ABAPers to look for functional work in order to get respect.

        And to make it clear, I go hyper not because of your post, it’s because I see a lot of people say these things with zero malice, but the myths are propagated.

        (0) 
    2. Jelena Perfiljeva

      Functional consultants might not have the developers key that I’m sure is needed to do this kind of user exit. Also ABAP changes may need to be done in a separate client where functional folks don’ have access. In some public companies separation of duties is enforced sometimes to the point of paranoia, you wouldn’t believe.

      (0) 
      1. Joao Sousa

        I believe that are situations like that, but I’ve never actually seen them. What I have seen are functional consultant refusing to write 10 lines of code in SE38, when they have no problem writing it down in Outlook.

        Anyway I admit I went hyper but this is touchy subject. And it’s not personal, since I’ve always done the funcional work, I just think it is a bad way to manage a group of people and I keep seeing good programmers see no choice but to join the functional side, on many many companies.

        (0) 
  3. Florian Henninger

    Just something to add:

    one field is needed… why select all fields?

    And why using a Table-Statement? You could also do it with a Count-statement, but I would at least prefer this coding-snippet. Just to make sure, the coding is really only processed when the client equals 400.

    DATA: lv_bsart type bsart.


    IF sy-mandt = ‘400’.

        SELECT SINGLE bsart

                FROM ekko

                INTO lv_bsart
               
    WHERE ebeln = i_wrxmod+0(10).
          IF sy-subrc = 0 AND lv_bsart = ‘ZSC’.
            e_konto_modif =
    ‘JWK’.
       ENDIF.

    ENDIF.

    I do not complain about the if-statement with the client or the hard-coded values. Everybody need to know if this is a way he/she wants to walk on.

    ~Florian

    (0) 
    1. Joao Sousa

      Since now you can do,

      select single bsart from ekko into @data(lv_bsart)

      A lot of the lazy induced * will disappear 🙂 . Eventually. 🙂

      (0) 
    2. Dibyendu Patra Post author

      If I do not want to restrict it for client 400 only, then I need to remove these two lines

      IF sy-mandt = ‘400’.

      ENDIF.

      Isn’t it ?

      (0) 
      1. Florian Henninger

        Yes, you are right, but in your code the second if-Statement is always processed.

        I don’t want to set the focus on the client, I want to just improve your code-snippet, that all the code is just processed, when the client equals 400.

        That’s it 😉

        ~Florian

        (0) 
        1. Jelena Perfiljeva

          At first you guys complain that functional folks can’t write a few ABAP code lines. But then you complain about the quality of those ABAP lines. Seems a little illogical to me. 😕

          (0) 
            1. Jelena Perfiljeva

              Well, I guess then you two make The Perfect Troll together. 🙂

              But this kind of one of the answers why ABAPers should be the ones writing the code – so that there is no stuff like hard-coded client and SELECT *.

              (0) 
              1. Matt Fraser

                Well, to be fair, I have examples in my organization of ABAPers who hard-code stuff, and use select * and FAE and all other kinds of verboten practices.

                But, separate of duties is a concern in organizations like ours, and even more of a concern is the cost of developer’s keys. We only have a handful of those. On the other hand, we have two functional analysts on our team who are former ABAPers, and I keep threatening to give them developer’s keys and they are like “no way!” But they do write the best technical specs, so our ‘actual’ ABAPers love working with them.

                (0) 
              2. Joao Sousa

                But this kind of one of the answers why ABAPers should be the ones writing the code – so that there is no stuff like hard-coded client and SELECT *.

                Because ABAPer never hardcode and select *  right? 😉

                We are awesome tag team! 🙂

                (0) 
  4. Tanmoy Debnath

    I am using it to fulfill my requirement . Very nice document.

    But my question is, is this mandatory to define the client.  Because suppose I have 4 client so I have to write same coding in every client .

    (0) 

Leave a Reply