‎2007 Jun 27 5:26 AM
HI,
I AM UNABLE TO DISPLAY THE 3 SECONDARY LIST HELP ME OUT THIS MY CODE
&----
*& Report YMP_INTERACTIVE_HIDE *
*& *
&----
*& *
*& *
&----
REPORT YMP_INTERACTIVE_HIDE .
TABLES VBAK.
SELECT-OPTIONS : S_VBELN FOR VBAK-VBELN.
TYPES : BEGIN OF TY_VBAK,
VBELN TYPE VBELN_VA,
ERDAT TYPE ERDAT,
ERNAM TYPE ERNAM,
END OF TY_VBAK.
TYPES : BEGIN OF TY_VBAP,
VBELN TYPE VBELN_VA,
POSNR TYPE POSNR_VA,
MATNR TYPE MATNR,
END OF TY_VBAP.
TYPES : BEGIN OF TY_MARA,
MATNR TYPE MATNR,
MTART TYPE MTART,
MBRSH TYPE MBRSH,
END OF TY_MARA.
TYPES : TT_VBAK TYPE STANDARD TABLE OF TY_VBAK,
TT_VBAP TYPE STANDARD TABLE OF TY_VBAP,
TT_MARA TYPE STANDARD TABLE OF TY_MARA.
DATA : IT_VBAK TYPE TT_VBAK WITH HEADER LINE,
IT_VBAP TYPE TT_VBAP WITH HEADER LINE,
IT_MARA TYPE TT_MARA WITH HEADER LINE.
DATA : VAR1(10),
VAR2(10).
START-OF-SELECTION.
SELECT VBELN
ERDAT
ERNAM
FROM VBAK
INTO TABLE IT_VBAK
WHERE VBELN IN S_VBELN.
LOOP AT IT_VBAK.
WRITE : / IT_VBAK-VBELN,IT_VBAK-ERDAT,IT_VBAK-ERNAM.
ENDLOOP.
AT LINE-SELECTION.
CASE SY-LSIND.
WHEN '1'.
GET CURSOR FIELD VAR1 VALUE VAR2.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = VAR2
IMPORTING
OUTPUT = VAR2.
SELECT VBELN
POSNR
MATNR
FROM VBAP
INTO TABLE IT_VBAP
WHERE VBELN EQ VAR2.
LOOP AT IT_VBAP.
WRITE : / IT_VBAP-VBELN,IT_VBAP-POSNR,IT_VBAP-MATNR.
ENDLOOP.
CLEAR : VAR1,VAR2.
WHEN '2'.
GET CURSOR FIELD VAR1 VALUE VAR2.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = VAR2
IMPORTING
OUTPUT = VAR2 .
SELECT MATNR
MTART
MBRSH
FROM MARA
INTO TABLE IT_MARA
WHERE MATNR EQ VAR2.
LOOP AT IT_MARA.
WRITE : / IT_MARA-MATNR,IT_MARA-MTART,IT_MARA-MBRSH.
ENDLOOP.
ENDCASE.
‎2007 Jun 27 5:56 AM
Hi
U have worte condition in Case statement.
Instead of case statement use if condition like
If sy-lsind = 1.
write ur code.
endif.
if sy-lsind = 2.
write ur code
endif..
if u want to process more no of different secondry list use
if sy-lsind with ur index number...
if its common for all then dont use if condition.
Reward me if its useful..
let me know ur problem has been sloved or not.
Regards
Ravi
‎2007 Jun 27 5:37 AM
Hi,
1. debugg your internal table whether you are getting data or not.
Don't forget to reward if useful....
‎2007 Jun 27 5:39 AM
HI,
I HAVE DONE THAT ONE ALSO I AM GETING IN THE DEBUGING SCREEN BUT I AM NOT GETTING THE OUT PUT
‎2007 Jun 27 5:38 AM
Hi,
You have to add the code for displaying the third list.
CASE SY-LSIND.
WHEN '1'.
..............
WHEN '2'.
.............
WHEN '3'." add this statement.
..............."add your code here.
ENDCASE.Regards,
Richa
‎2007 Jun 27 5:41 AM
‎2007 Jun 27 5:50 AM
Hi,
Please check. You haven't done as told by Richa.
Regards,
Atish
‎2007 Jun 27 5:55 AM
Hi maruvada phanindra ,
Please don't use get cursor, instead of this in loop statement use
HIDE variable for which field u r passing to next Select statement.
Thanks & Regards,
jogu_vinesh@yahoo.com
‎2007 Jun 27 5:56 AM
Hi
U have worte condition in Case statement.
Instead of case statement use if condition like
If sy-lsind = 1.
write ur code.
endif.
if sy-lsind = 2.
write ur code
endif..
if u want to process more no of different secondry list use
if sy-lsind with ur index number...
if its common for all then dont use if condition.
Reward me if its useful..
let me know ur problem has been sloved or not.
Regards
Ravi
‎2007 Jun 27 5:57 AM
Your program working fine except two areas:
1. to get the second interactive list you always have to clicek vbeln of the first list though there are also ERDAT & ERNAM in the basic list.
But while selecting data for the first secondary list you have taken into account VBELN .
SELECT VBELN
POSNR
MATNR
FROM VBAP
INTO TABLE IT_VBAP
WHERE VBELN EQ VAR2.so, if you click ERDAT or ERNAM, the above select query will not work.
The same thing also get repeted in case of getting third list from second list.
<b>Better you can use HIDE command instead of 'GET CURSOR FIELD VAR1 VALUE VAR2. statement.</b>
HIDE
Basic form
HIDE f.
The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Cannot Use Constants in the HIDE Area.
Effect
The contents of f related to the current output line are stored. If this line is selected, f is filled automatically with the stored value.
The selection can be made using:
AT LINE-SELECTION
AT PFx
AT USER-COMMAND
READ LINE
You do not have to output the field with WRITE in order to be able to store its value.
The HIDE statement does not support structures that contain tables (deep structures).
System fields that are particularly useful in interactive reporting are listed in the system fields for lists documentation.
Note
You cannot save lines or components of lines of an internal table that is addressed using a field symbol to the HIDE area. (Compare the ASSIGNING addition to the READ and LOOP statements). Assign the contents of the line or component to a global variable and save this instead.
Re<u><i><b>fer the following program to know how hide command works:</b></i></u>
REPORT demo_list_hide NO STANDARD PAGE HEADING.
TABLES: spfli, sbook.
DATA: num TYPE i,
dat TYPE d.
START-OF-SELECTION.
num = 0.
SET PF-STATUS 'FLIGHT'.
GET spfli.
num = num + 1.
WRITE: / spfli-carrid, spfli-connid,
spfli-cityfrom, spfli-cityto.
HIDE: spfli-carrid, spfli-connid, num.
END-OF-SELECTION.
CLEAR num.
TOP-OF-PAGE.
WRITE 'List of Flights'.
ULINE.
WRITE 'CA CONN FROM TO'.
ULINE.
TOP-OF-PAGE DURING LINE-SELECTION.
CASE sy-pfkey.
WHEN 'BOOKING'.
WRITE sy-lisel.
ULINE.
WHEN 'WIND'.
WRITE: 'Booking', sbook-bookid,
/ 'Date ', sbook-fldate.
ULINE.
ENDCASE.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'SELE'.
IF num NE 0.
SET PF-STATUS 'BOOKING'.
CLEAR dat.
SELECT * FROM sbook WHERE carrid = spfli-carrid
AND connid = spfli-connid.
IF sbook-fldate NE dat.
dat = sbook-fldate.
SKIP.
WRITE / sbook-fldate.
POSITION 16.
ELSE.
NEW-LINE.
POSITION 16.
ENDIF.
WRITE sbook-bookid.
HIDE: sbook-bookid, sbook-fldate, sbook-custtype,
sbook-smoker, sbook-luggweight, sbook-class.
ENDSELECT.
IF sy-subrc NE 0.
WRITE / 'No bookings for this flight'.
ENDIF.
num = 0.
CLEAR sbook-bookid.
ENDIF.
WHEN 'INFO'.
IF NOT sbook-bookid IS INITIAL.
SET PF-STATUS 'WIND'.
SET TITLEBAR 'BKI'.
WINDOW STARTING AT 30 5 ENDING AT 60 10.
WRITE: 'Customer type :', sbook-custtype,
/ 'Smoker :', sbook-smoker,
/ 'Luggage weigtht :', sbook-luggweight UNIT 'KG',
/ 'Class :', sbook-class.
ENDIF.
ENDCASE.2. Your conversion exit 'CONVERSION_EXIT_ALPHA_INPUT' in the 3rd list is not working properly, It converting the matnr to 10 character field but it sould convert matnr to 18 character.