‎2010 Sep 16 7:53 AM
hi this is saroj,
i have done one interactive report using vbak and vbap.i gotdata from two tables by using for all entries and populated
to IT_FINAL.i am getting grid display for vbak like VBELN,ERDAT.WHILE DOUBLE CLICKING ON VBELN OF VBAK
all data of vbap came like VBELN POSNR.I NEED ONLY THE CORRESPONDING DATA OF A PARTICULAR RECORD.
MY CODE:
PERFORM USER USING FCODE SELFIELD.
FORM USER FCODE LIKE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD.
CASE FCODE.
WHEN '&IC1'.
READ TABLE IT_FINAL INTO WA_FINAL INDEX SELFIELD-TABINDEX.
PERFORM FIELDCAT.
PERFORM EVENT.
PERFORM POO_EVENT.
PERFORM GET_DATA.
PERFORM LIST_DIS.
ENDCASE.
I AM NOT READING IT_VBAK, I AM READING IT_FINAL.i have seen many sample alv reports that shows this
'READ TABLE IT_FINAL INTO WA_FINAL INDEX SELFIELD-TABINDEX' statement,but i dont think it realy works.
SO abapres plz give me solution to get secondary list for a PARTCULAR RECORD.WAITING FOR RESPONSE.
THANKS
saroj
‎2010 Sep 16 8:12 AM
Hello Saroj,
'READ TABLE IT_FINAL INTO WA_FINAL INDEX SELFIELD-TABINDEX' statement,but i dont think it realy works
Not sure what you mean by this statement ?
SELFIELD-TABINDEX --> Stores the table index of the output internal table, if you pass IT_FINAL to REUSE* FM then READ TABLE with SELFIELD-TABINDEX should work.
If you want to get the value of the particular cell on which you've double clicked, then you should use SELFIELD-VALUE.
BR,
Suhas
‎2010 Sep 16 8:25 AM
so suhas you mean in place of READ TABLE IT_FINAL INTO WA_FINAL INDEX SELFIELD-TABINDEX i should use
READ TABLE IT_FINAL INTO WA_FINAL INDEX SELFIELD-VALUE
SAROJ.
‎2010 Sep 16 8:44 AM
No, in debug mode what is the value in the field SELFIELD-TABINDEX? This should contain the index of the table line on which you've double clicked.
‎2010 Sep 16 8:15 AM
Hi,
It works perfectly.
Please check why you are calling this perform :
PERFORM USER USING FCODE SELFIELD.
There is no need to call the perform in interactive ALV's.
while calling ALV FM .. pass this parameter
i_callback_user_command = 'USER'.'
Regards,
Srini.
‎2010 Sep 16 9:14 AM
Hi Saroj,
your code is right. READ TABLE IT_FINAL INTO WA_FINAL INDEX SELFIELD-TABINDEX. this will read the particular row(where you clicked) into wa_final. then you can choose the required fields (from vbap). no need to use all teh fields in wa_final. if you want more fileds from VBAP, u can write another select query where vbeln = wa_final-vbeln.
hope this will resolve your issue.
regards,
Christy
‎2010 Sep 17 7:13 AM
Christy i am getting secondary list for VBELN POSNR.but i am getting all records of selected range i.e. select-options.my issue is that i should get the partcular POSNR FOR A PARTICULAR VBELN THAT IS THE VBELN NUMBER ON WHICH I DOUBLE CLICK.
by using the code i am not getting the desired output : 'READ TABLE IT_FINAL INTO WA_FINAL INDEX SELFIELD-TABINDEX'.
i think i should use the code:
DATA: VALUE1 TYPE VBAK-VBELN
CASE FCODE.
WHEN '&IC1'.
MOVE SELFIELD-VALUE TO VALUE1.
READ TABLE IT_FINAL INTO WA_FINAL WITH KEY VBELN = VALIE1.
PERFORM 'GET ....'.
ENDCASE.
‎2010 Sep 17 7:16 AM
Hi,
What is the code written inside?
PERFORM 'GET ....'.Regards
Vinod
‎2010 Sep 17 7:31 AM
it is some perform statements like
PERFORM FIELDCAT_DATA.
PERFORM EVENT_DATA.
PERFORM POPULATE_EVENT.
PERFORM GET_DATA.
PERFORM DIS_DATA.
‎2010 Sep 17 7:41 AM
Hi,
Explain the code you have written for displaying the data in secondary List.
PERFORM GET_DATA.
PERFORM DIS_DATA.Regards
Vinod
‎2010 Sep 17 7:58 AM
vinod i have all data in IT_FINAL.MY REQUIREMENT IS TO GET VBELN POSNR FOR A PARTICULAR VBELN OF VBAK.
SO PERFORM GET_DATA IS NOT REQUIRED.
SO TELL ME MY CODE IS CRRECT OR NOT WHICH I HAVE MENTIONED IF IT IS WRONG PLZ GIVE ME CORRECT CODE.
IN GENERAL I HAVE ALL DATA ACCORDING TO SELECTION-SCREEN IN IT_FINAL.SO IF I DOUBLE CLICK ON VBELN OF VBAK
IT SHOULD GIVE CORRESPONDING VBELN POSNR ON WHICH I DOUBLE CLICK.I HAVE ALSO TRIED WITH 'SET PARAMETER AND GET PARAMETER', BUT OF NO USE.
‎2010 Sep 17 8:15 AM
Hi,
You cannot use the same internal table for filtered data.
You can use following logic.
define internal table itab_final1 similar to it_final.
define workarea wa_final1 similar to wa_final.
READ TABLE IT_FINAL INTO WA_FINAL INDEX SELFIELD-TABINDEX.
refresh : it_final1.
loop at it_final into wa_final1 where vbeln = wa_final-vbeln
and posnr = wa_final-posnr.
append wa_final1 to it_final1.
endloop.Display the content in alv display for secondary list using the internal table it_final1 which will contain the data related to selected VBELN and POSNR.
Regards
Vinod
‎2010 Sep 17 9:26 AM
‎2010 Sep 20 8:36 AM