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

ALV REPORT

divsmart
Participant
0 Likes
2,151

report.txtop.jpgHi ,

I am new to ABAP, me developed an ALV report to get the "material report'. Here i Set an "appliction toolbar as "ITEM". So when i click the button need to get the relavant data for "MARD". Can someone provide the logic for it..

I have attachement the code snippet and output i i got.

Thanks.

report.txtop.jpgHi ,

I am new to ABAP, me developed an ALV report to get the "material report'. Here i Set an "appliction toolbar as "ITEM". So when i click the button need to get the relavant data for "MARD". Can someone provide the logic for it..

I have attachement the code snippet and output i i got.

Thanks.

7 REPLIES 7
Read only

Sandra_Rossi
Active Contributor
2,023

Your requirement "get the relavant data for MARD" is meaningless, what are the rules to access this table when the button "ITEM" is pressed? (my crystal ball is not sufficient to guess what is in your head).

NB: REUSE_ALV_GRID_DISPLAY and REUSE_ALV_LIST_DISPLAY are obsolete function modules, they have been superseded by CL_SALV_TABLE.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,023

Did you check the parameters your (outdated) user_command form receives, you should be able to find easily the row of the internal table to read...

Is this an imposed exercise, or do you have a choice of tool to use?

Read only

0 Likes
2,023

User-command parameters:

  • rs_selfield contains the index of the internal table, so read the record to pass parameters to next screen.
  • r_ucomm contains your function code
Read only

divsmart
Participant
0 Likes
2,023

raymond.giuseppi

Yes, i checked the user_commant its not receive the form_mard.

Just i practising myself, this is not an requirment.

Read only

2,023

Please use the COMMENT button for comments, questions, adding details, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.

Read only

dev_parbutteea
Active Contributor
0 Likes
2,023

row id that you selected in IT_LAST should be stored in rs_selfield-tabindex

Read only

matt
Active Contributor
2,023

As a beginner in ABAP you're starting in the wrong place, using procedural. Of course these language elements need to be understood - but only for maintaining legacy applications. I strongly recommend that you try to rewrite your program using a local class, and CL_SALV_TABLE instead of REUSE_ALV_GRID_DISPLAY.

Three points regarding your code.

1. Don't use prefixes on your variables. Use meaningful names instead. If you must use prefixes, then make sure they're the correct prefix. You've used the L prefix to refer to variables that are manifestly global.

2. Absolutely minimise the use of global variables. Much better to use parameters on subroutines, and local variables.

3. TABLES is an obsolete statement.

There are some great resources for learning to program ABAP in a modern way. It looks like you've got hold of some dinosaur tutorials, written for ABAP as it was over 20 years ago!