Skip to Content

Use loop in AMDP

Hi Gurus,

I have the below mentioned requirement to be achieved using AMDP..

There are two tables: TAB1 and TAB2.

I have to populate some fields in TAB1 based on the values in TAB2(using the value to calculate result based on a formula).

In traditional ABAP, it is easy to achieve. Could you please suggest what syntax to use if i want to write the logic using AMDP.

Thanks and Regards,

Sahil

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Dec 07, 2016 at 06:09 AM

    Hello Sahil,

    in SQLScript there exists also Imperative Statements (e.g. control structures like IF, WHILE LOOP, Cursors ...) which can be used for such scenarios if really necessary. You only have to consider that this will be very slow from a performance point of view.

    Depending on what you have written I think the requirement can also be implemented using a SELECT statement which joins both tables and does the calculation using an expression. But as you did not share more details on your requirement this is just an assumption and has to verified.

    Regards,
    Florian

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 07, 2016 at 09:57 PM

    Hello Florian,

    Thanks for the reply.

    Please find the requirement as below:

    Table FAGLFLEXA: This table has multiple lines for a line item of a FI document in table BSEG. The Tax amount Key figure is empty in this table for all line items. The requirement is to get the value of this line item from table BSEG for the same key fields and apply formula to populate different values for the line items in FAGLFLEXA.

    In ABAP, this could have been achieved by a loop and Read statement. As, I am very new to AMDP Could you please advise how to achieve this using AMDP using Select statements.

    Please let me know if there are any queries. Thank you.

    Regards,

    Sahil

    Add comment
    10|10000 characters needed characters exceeded