Skip to Content

eCatt for multiple (variable) line items

My question has already been posted here but the creator didn't replay so I try again.

I recorded an eCATT-script that sets the Closed-indicator (EBAN-EBAKZ) in a pr item with an example document with one item line.

I need to enable the script to do the same for documents with varying numbers of item lines and select the next item line each time.

Do you have any suggestions?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Feb 27, 2019 at 10:58 AM

    Hello,

    I do not know if it works in your case but in general it is possible to have a dynpro with some lines and the user selects a

    specific line (and the next time another).

    When you record the script, you can see on which line the user has clicked. This information you have to put in a parameter (for example V_SELECT).

    Now you must write an inline ABAP. You must loop about the tables which are used in your dynpro. For example you have 5 lines in dynpro, then you have in the ABAP an internal table with 5 entries. Now you match your test data with the internal table and maybe it is the third entry.

    The user has to click on the third line, so V_SELECT is 3(in SAPGUI it is "getAbsoluteRow" = V_SELECT)

    ABAP.

    SELECT * FROM mytable INTO TABLE v_it_mytable

    WHERE my condition 1

    AND my condition 2

    ORDER BY whatever is useful ASCENDING.

    v_rc = sy-subrc. *I have found something

    ENDABAP.

    IF ( v_rc = 0 ). GETLEN (v_it_mytable , v_len ).

    DO v_len.

    v_var = v_itmytable[&lpc]-xxx. * xxx = what I am looking for

    EXIT ( v_var = i_xxx ). * found it, i_xxx is an import parameter

    v_select = &lpc.

    ENDDO.

    ENDIF.

    Hope that this helps you. We used this in scripts and it worked.

    Add a comment
    10|10000 characters needed characters exceeded

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.