Skip to Content
author's profile photo Former Member
Former Member

Dual Nature for Abap code.


Requirment is

For a Material,

Orders required quantity

components for that material

their requirment.

my program takes material and orders from RESB table.

to get components i am looping through header table using Function module -'CS_BOM_EXPL_MAT_V2'.

If i do the debugginf i am able to see that data is going properly to internal table. but when i execute, Components data is missing.

Any body can help me in this?

What might be the cause?


Lijo Joseph


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Dec 21, 2004 at 06:50 AM

    It will be really difficult to address your issue with the info. you have given. Can you post the code here , that will help us to analyze it better.



    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Poornanand,

      From Lijo's last post, it is clear that a COMMIT statement has been written. In that post, it is also mentioned that this COMMIT is written in the event TOP-OF-PAGE. From the code, we see that the 'Z' function module is called in the event TOP-OF-PAGE, not the SAP FM. So I am a little confused, whether the SAP FM saves the data in the database or the 'Z' FM saves the data in the database.

      You have also mentioned that you have tried this program and it works perfectly fine. So it again points that the 'Z' FM is what has the problem. I am not sure for that matter.

      Now to come to the question: How does it influence the contents of the internal table in the program ? God only knows.

      If TOP-OF-PAGE does not fire properly, the other contents in that list would not come properly. So I am still thinking the mystery is in that 'Z' FM and the problem would have been solved not by that mysterious COMMIT but by commenting the TOP-OF-PAGE.

      Many questions are still in my mind, but as I was figuring out one of the many answered questions in SDN, one person asked, the question is answered, why bother ? So there.


      Subramanian V.

  • Posted on Dec 21, 2004 at 05:01 PM

    Hi Joseph,

    I know that this has been answered already but I am curious like others to find out why such a simple program has to become a complicated one. We used the function module CS_BOM_EXPL_MAT_V2 a lot and we didn't get any problem.

    If you pasted the code correctly, I see a problem with a statement right before your ENDAT statement and after the ENDLOOP of stb. The statement is

    write: sy-uline.

    This will overwrite the last written line in your output as you are not writing the ULINE on a new line, but writing it on the same line.

    Also, RESB stores reservations for all the components after BOM explosion, so your call to BOM explosion, in all probability will return only one material, if the material is the lowest component, and if the material is a sub-assembly then you may get more than one record in your internal table 'stb'.

    Now here are some suggestions for your code.

    Change the statement 'WRITE: ULINE.' to 'WRITE:/ ULINE.'.

    You are not refreshing the contents of your internal table 'stb', before the call to the BOM explosion FM. Please do that to avoide any leftovers.

    Please let me know if this helps.


    Add a comment
    10|10000 characters needed characters exceeded

    • Now that you have isolated the problem to your TOP-OF-PAGE, Z function module, take a closer look at your Z function module's 'write' statements. Also, sometimes a format reset after the call to your Z function module might work.

      Also, can you confirm that you are loosing data only when the top-of-page is triggered, no other time?

      I am inclined to believe that there is some 'write' statement in the Z function module that is overwriting your lines or there is some format statement that is making your line disappear.

      Please check in debugging, whether you see the list line before and after top-of-page.



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.