Reply: 6

Auto translated

LSMW for transaction KB11N

Good day,
I have developed a LSMW for the transaction KB11N (reposting from cost center to cost center).
It works in the list display as well as in the single display.
But: for each row (also in the list) the system generates a separate CO document.
Is there any way to stop this in the LSMW?
Hints:
I don't want to use Batchman etc.
Of course, one could also write a small program.
Many thanks for hints.
Thomas

You must be logged in to post a reply.

Login now

6 Answers

  • spaco
    spaco
    Hello Thomas,
    you could also use comfortable 3rd party products.
    Back to your concern: Isn't this more a question of suboptimal recording of the KB11N you are using as part of the LSMW?
    Best regards
    Ulrich Fahrnschon
  • sap_forsthuber
    sap_forsthuber
    Hello,
    maybe one of the two ideas I have will help you:
    (i) if you work with recording, you should use the pushbutton position before you record a position, enter the one a there, then the cursor is in the first line and you can record it afterwards. after that, the position button is also included in the recording and you can build a loop around it in the fieldmapping - so it should actually work then.
    (ii) instead of recording with bi, use the bapi BAPI_ACC_PRIMARY_COSTS_POST and direct input. then it will work in any case, i have already used it myself.
    Heinz Forsthuber
    Kern Aktiengesellschaft
    Freiburg
  • Deleted
    Deleted
    Hello Mr. Forsthuber,
    thank you very much for the tips, which helped me.
    Comments (+++) see below please.
    With kind regards
    Langheim
    Hello,
    maybe one of the two ideas I have will help you:
    i) if you are working with recording, you should use the position pushbutton before you record a position, enter the one a there, then the cursor is in the first line and you can record it afterwards. after that the position pushbutton is also included in the recording and you can build a loop around it in the fieldmapping - so it should actually work then.
    +++
    The loop seems unavoidable.
    (ii) use instead of the recording with bi the bapi BAPI_ACC_PRIMARY_COSTS_POST and direct input. then it works in any case, i have already used it myself.
    +++
    Indeed, it worked well.
    But also here a CO document was generated per line.
    Again, therefore the assumption that a loop is required.
    Heinz Forsthuber
    Kern Aktiengesellschaft
    Freiburg

  • ij2511
    ij2511
    Hi all,
    I would like to use the BAPI_ACC_PRIMARY_COSTS_POST to solve my 'challenge'.
    and have first called this with the SE37 in test mode and tried it out.
    It also diligently generates document numbers, but no documents are written.
    I seem to be doing something wrong, but what? Can anyone help me with this.
    As is so often the case, I'm sure it will be something quite mundane.
    Many greetings
    ij2511
  • MrBojangles
    MrBojangles
    Hello,
    usually people forget to send a "Commit Work", most BAPIs do not do this by themselves. If you keep it with the SE37, you go in the menu on "Function module - Execute - Test sequences...".
    There you connect your BAPI with the BAPI_TRANSACTION_COMMIT "in series". Then there is also a document to the document number!
    An example program (but for another BAPI from the CO environment) can be found here: http://sapmandoo.over-blog.de/article-le...-124443845.html
    Have fun with SAP...
    Cheers
    MrB.
    Blog

    Last edited on 29.11.17 17:25

  • ij2511
    ij2511
    Thank you very much!
    The COMMIT was indeed missing. As soon as you know how to do it, it works.
    Many greetings
    ij2511