cancel
Showing results for 
Search instead for 
Did you mean: 

eCatt for multiple (variable) line items

02-26-2019 5:04 PM
bgconsulting Newcomer
578 views 1 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

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?

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

JanSchlichting
Active Participant
0 Likes

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.

Answers (0)