Skip to Content
author's profile photo Former Member
Former Member

interactive report--hide statement?

hi

I am making an interactive report,but my hide statement is not working.my code is like:

START-OF-SELECTION.

SELECT matnr

mtart

matkl

INTO CORRESPONDING FIELDS OF TABLE itab1

FROM mara WHERE matnr IN p_matnr.

WRITE:/4 'Material No.' ,22 'Material Type' ,

37 'Material Group'.

WRITE:/ sy-uline.

LOOP AT itab1.

WRITE:/4 itab1-matnr ,20 sy-vline ,22 itab1-mtart ,

35 sy-vline ,37 itab1-matkl,sy-uline.

HIDE itab1-matnr.

ENDLOOP.

AT LINE-SELECTION.

CASE sy-lsind.

WHEN '1'.

SELECT amatnr bmaktx INTO CORRESPONDING FIELDS OF TABLE itab2

FROM ( mara AS a INNER JOIN makt AS b ON amatnr = bmatnr )

WHERE a~matnr = itab1-matnr.

WRITE:/ sy-uline.

WRITE:/4 'Material No.' ,22 'Material Text'.

WRITE:/ sy-uline.

LOOP AT itab2.

WRITE:/4 itab2-matnr ,20 sy-vline ,22 itab2-maktx,

sy-uline.

ENDLOOP.

here when my at line-selction is working,in select query,hide is not updated,its contains the last record value f itab1,where it should have value i selected from display.

thus my seconday list is showing the value of last record of itab1 all time.

please tell,how to make it working?

vipin

Edited by: Vipin on Jun 18, 2008 5:23 PM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 11:54 AM

    do this way ....

    LOOP AT itab1.

    WRITE:/4 itab1-matnr ,20 sy-vline ,22 itab1-mtart ,

    35 sy-vline ,37 itab1-matkl,sy-uline.

    ENDLOOP.

    HIDE itab1-matnr.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 12:07 PM

    hi

    ur code seems to be correct

    but its beeter to check it once in debugger

    Cheers

    snehi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 12:11 PM

    hi do like this.

    LOOP AT itab1 wa_itab1.

    WRITE:/4 wa_itab1-matnr ,20 sy-vline ,22 wa_itab1-mtart ,

    35 sy-vline ,37 wa_itab1-matkl,sy-uline.

    HIDE wa_itab1-matnr.

    clear wa_itab1-matnr.

    ENDLOOP.

    Regards

    Sandeep REddy

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 12:12 PM

    Hi,

    You cannot save lines or components of lines of an internal table that is addressed using a field symbol to the HIDE area. Assign the contents of the line or component to a global variable and save this instead.

    So you need to copy the value of itab1-matnr itno variable and HIDE that variable.

    I hope this will help you.

    Plz reward if useful.

    Thanks,

    Dhanashri.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 12:13 PM

    Hi,

    Check the example code , this will help you.

    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-carridAND

    IF sbook-fldate NE dat.connid = spfli-connid. 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 weight :', sbook-luggweight UNIT 'KG',

    / 'Class :', sbook-class.

    ENDIF.

    ENDCASE.

    Regards,

    Raj.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 12:25 PM

    Hi vipin

    Remove uline from your code

    after doing this your code working fine

    Assign points

    Ankit.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.