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

case stmt - error

Hi All,

I wrote the Sy-ucomm case stmt like this, it is giving me the following errror on

at user-command.

case sy-ucomm.

when 'SELALL'.

LOOP AT IT_OUTPUT.

IT_OUTPUT-CHECK = 'X'.

MODIFY IT_OUTPUT WHERE CHECK = ' '

TRANSPORTING CHECK.

  • clear sy-ucomm.

ENDLOOP.

when 'DESALL'.

LOOP AT IT_OUTPUT.

IT_OUTPUT-CHECK = ' '.

MODIFY IT_OUTPUT WHERE CHECK = 'X'

TRANSPORTING CHECK.

  • clear sy-ucomm.

ENDLOOP.

endcase.

error --> "WHERE CHECK = ' '" is not expected.

when 'SELALL'.

LOOP AT IT_OUTPUT.

IT_OUTPUT-CHECK = 'X'.

---> MODIFY IT_OUTPUT WHERE CHECK = ' '

TRANSPORTING CHECK.

Can you please help me resolve this.

Thanks

Veni.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2006 at 04:53 PM

    Hi,

    Use

    modify IT_OUTPUT

    transporting check

    where check = ' '

    .

    Also you don't have do LOOP AT IT_OUTPUT..

    Thanks,

    Naren

    Message was edited by: Narendran Muthukumaran

    Add a comment
    10|10000 characters needed characters exceeded

    • You still need to re-write the list, right?

      
      start-of-selection. 
       PERFORM GET_DATA.  
       PERFORM PROCESS_DATA.  
       PERFORM DISPLAY_DATA.
      
      at user-command.  
        case sy-ucomm.   
         when 'SELALL'.   
           LOOP AT IT_OUTPUT.  
              IT_OUTPUT-CHECK = 'X'.
              MODIFY IT_OUTPUT   
                   TRANSPORTING CHECK     
                            WHERE CHECK = ' '.    
           ENDLOOP.    
      
      <b>     sy-lsind = sy-lsind - 1.
           PERFORM DISPLAY_DATA.</b>
      
      when 'DESALL'.    
           LOOP AT IT_OUTPUT.  
              IT_OUTPUT-CHECK = ' '.  
              MODIFY IT_OUTPUT.   
           ENDLOOP.
      
      <b>     sy-lsind = sy-lsind - 1.
           PERFORM DISPLAY_DATA.</b>
      
      ......
      
      

      Regards,

      Rich Heilman

  • Posted on Oct 20, 2006 at 04:49 PM

    You don't need to do all that, just do like this.

    case sy-ucomm.
    when 'SELALL'.
    LOOP AT IT_OUTPUT.
    <b>IT_OUTPUT-CHECK = 'X'.
    MODIFY IT_OUTPUT.</b>
    * clear sy-ucomm.
    ENDLOOP.
    when 'DESALL'.
    LOOP AT IT_OUTPUT.
    <b>IT_OUTPUT-CHECK = space.
    MODIFY IT_OUTPUT .</b>
    * clear sy-ucomm.
    ENDLOOP.
    
    endcase.

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2006 at 05:43 PM

    Hi,

    Try this..The changes are marked in bold..

    REPORT ZSDR_DELIBLOCK

    no standard page heading line-size 255.

    ----


    • TABLES:

    ----


    TABLES: LIKP, TVLS.

    ----


    • INTERNAL TABLES *

    ----


    DATA: Begin of IT_LIKP occurs 0,

    VBELN like LIKP-VBELN,

    LFDAT like LIKP-LFDAT,

    KUNNR like LIKP-KUNNR,

    KNKLI LIKE LIKP-KNKLI,

    NETWR like LIKP-NETWR,

    End of IT_LIKP.

    DATA: Begin of IT_OUTPUT occurs 0,

    CHECK TYPE C,

    VBELN like LIKP-VBELN,

    LFDAT like LIKP-LFDAT,

    KUNNR like LIKP-KUNNR,

    KNKLI LIKE LIKP-KNKLI,

    NETWR like LIKP-NETWR,

    End of IT_OUTPUT.

    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

    SELECT-OPTIONS: S_LFDAT FOR LIKP-LFDAT,

    S_KUNNR FOR LIKP-KUNNR.

    PARAMETERS: P_LIFSK TYPE LIKP-LIFSK DEFAULT '01'.

    SELECTION-SCREEN END OF BLOCK b1.

    at selection-screen output.

    loop at screen.

    if screen-name = 'P_LIFSK'.

    screen-input = 0.

    modify screen.

    endif.

    endloop.

    start-of-selection.

    PERFORM GET_DATA.

    PERFORM PROCESS_DATA.

    PERFORM DISPLAY_DATA.

    <b>data: v_index type int4.</b>

    at user-command.

    case sy-ucomm.

    when 'SELALL'.

    LOOP AT IT_OUTPUT.

    IT_OUTPUT-CHECK = 'X'.

    MODIFY IT_OUTPUT

    TRANSPORTING CHECK

    WHERE CHECK = ' '.

    <b> v_index = sy-tabix + 6.

    MODIFY LINE v_index

    FIELD VALUE IT_OUTPUT-CHECK FROM 'X'.</b>

    ENDLOOP.

    when 'DESALL'.

    LOOP AT IT_OUTPUT.

    IT_OUTPUT-CHECK = ' '.

    MODIFY IT_OUTPUT.

    <b> v_index = sy-tabix + 6.

    MODIFY LINE v_index

    FIELD VALUE IT_OUTPUT-CHECK FROM ' '.</b>

    ENDLOOP.

    • when 'BLOCKREMOV'.

    • LOOP AT IT_OUTPUT.

    • IF ( IT_OUTPUT-CHECK = 'X' AND sy-ucomm = 'BLOCKREMOV' ).

    *

    • ENDIF.

    • ENDLOOP.

    • clear sy-ucomm.

    endcase.

    FORM get_data.

    SELECT VBELN LFDAT KUNNR KNKLI NETWR

    FROM LIKP

    INTO TABLE IT_LIKP

    WHERE LFDAT IN S_LFDAT

    AND KUNNR IN S_KUNNR

    AND LIFSK = P_LIFSK.

    ENDFORM. " get_data

    FORM process_data.

    loop at it_LIKP.

    if sy-subrc = 0.

    move-corresponding it_LIKP to it_output.

    append it_output.

    clear it_output.

    endif.

    endloop.

    ENDFORM. " process_data

    FORM DISPLAY_DATA.

    format color col_heading intensified on.

    write: /2 'Report ID :',

    14 sy-repid,

    72 text-ttl,

    133 'Page:', ' ',

    sy-pagno left-justified.

    write: /2 text-h12,

    14 sy-tcode,

    133 'Date:', sy-datum, ''.

    write: /133 'Time:', sy-uzeit, ' ',

    73 'As Of:',

    80 sy-datum.

    new-line.

    uline.

    format color col_heading intensified off.

    format color col_group intensified on.

    set pf-status 'ZSTAT01'.

    write:/1 'chk',

    5 'Delivery',

    18 'Delivery date',

    36 'Ship-to party',

    53 'Cred. acct',

    74 'Net value'.

    uline.

    format color col_group intensified off.

    loop at it_output.

    write:/1 it_output-CHECK as checkbox,

    5 it_output-VBELN,

    20 it_output-LFDAT,

    39 it_output-KUNNR,

    55 it_output-KNKLI,

    68 it_output-NETWR.

    <b> hide it_output-check.</b>

    endloop.

    uline.

    ENDFORM. " DISPLAY_DATA

    Thanks,

    Naren

    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.