Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Module pool - Index problem!

Himayatullah
Active Participant
0 Likes
610

Hi All,

I have created a table control in modulepool. it has 3 columns like matnr, maktx and long text(shown as button) columns. The user will click on longtext button and enter the text for each material.

The problem is that when I have multiple entries and I scroll down and try to fill the long text for materials which are down the order, GET CURSOR line is not giving me the correct line index.

Say for example by default, 5 lines are shown and user enters long text for line item 3. Till  now everything fine, when I scroll down and try to enter texts for the line item 8,  the get cursor line is not giving me correct index number, it gives me index number as 3. What I am trying to say is it is considering only those lines which are visible as of now.In this case 6 to 10, so for line item 8 it gave result as 3 which is incorrect.

If you have better ideas of doing, let me know.

Best Regards

Himayat

1 ACCEPTED SOLUTION
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
575

You can do as follow. Lets say your table control is TC_TABLE.

Use the get cursor to fetch lines in LV_LINE

Curasr_index  = tc_table-top_line + lv_line -1.

Nabheet

3 REPLIES 3
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
576

You can do as follow. Lets say your table control is TC_TABLE.

Use the get cursor to fetch lines in LV_LINE

Curasr_index  = tc_table-top_line + lv_line -1.

Nabheet

Read only

Former Member
0 Likes
575

Hi Himayat,

GET CURSOR give you the current index on screen.
You have to add <CONTROLNAME>-TOP_LINE - 1 to the index returned by GET CURSOR to get the index into your internal table.

Cheers
   Adi

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
575

Not sure if this helps you. Try calling function DYNP_GET_STEPL to get the index. ( this is generally used in POV & POH )