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

SELECTION SCREEN

HI ALL,

i have one problem with the screen..

i have selection screen parameters say

p_matnr LIKE mara-matnr OBLIGATORY ,

p_charg LIKE mchb-charg OBLIGATORY,

p_werks LIKE marc-werks OBLIGATORY,

p_vbeln LIKE LIPS-vbeln 'delivery number

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vbeln.

PERFORM get_values.

FORM get_values .

SELECT * FROM lips CLIENT SPECIFIED INTO CORRESPONDING FIELDS OF TABLE p_it_values

WHERE mandt = sy-mandt

AND werks = p_werks

AND matnr = p_matnr

AND charg = p_charg.

here i am giving input as material and plant ,batch no( on selection screen)

here p_matnr shows space

p_charg show space

instaed of material and batch

what is the wrong pls let me knowwwwww

regards

suma

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Posted on Sep 07, 2007 at 11:15 AM

    Hi ,

    try to change the select query and check

    SELECT * FROM lips INTO CORRESPONDING FIELDS OF TABLE p_it_values

    WHERE mandt = sy-mandt

    AND werks = p_werks

    AND matnr = p_matnr

    AND charg = p_charg.

    Regards,

    Nagaraj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 11:23 AM

    hi

    u have given at selection screen on value request for p_vbeln

    so how can u get values for matnr and batch?

    hope i got ur question right....

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Check for 3 things.

      1. include table names in your Selection-screen program.

      2. check if same fieldname are present in the the table you are using(Table structure including name and size)

      3. check if the Primary key is having Unique values each time in the selection-screen.

      .Thanks

      Kapil

      <b><REMOVED BY MODERATOR></b>

      Message was edited by:

      Alvaro Tejada Galindo

  • Posted on Sep 07, 2007 at 11:24 AM

    The data is not yet transfered from screen to variable .. you have to use FM DYNP_VALUES_READ.. in event AT SELECTION-SCREEN to get correct value of variable see below code to ref how to use this FM

    REPORT zpwtest .
    
    TABLES tcurt.
    DATA   dyfields LIKE dynpread OCCURS 1 WITH HEADER LINE.
    
    DATA: BEGIN OF value_tab OCCURS 0,
                   name(10),
                 END OF value_tab.
    DATA :field_tab LIKE dfies  OCCURS 0 WITH HEADER LINE.
    DATA : return_tab LIKE ddshretval OCCURS 0 WITH HEADER LINE. DATA : x
    TYPE string.
    
    
    PARAMETERS: p_waers LIKE tcurt-waers,        "Currency
                p_ltext LIKE tcurt-ltext,        "Long Text
                p_ktext LIKE tcurt-ktext.        "Short Text
    
    PARAMETERS: p_name(10).
    
    *-----------------------------------------------------------------------
    
    *--- Example of updating value of another field on the screen ----------
    
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_waers.
      CLEAR: dyfields[], dyfields.
    *--- select currency
      CALL FUNCTION 'HELP_VALUES_GET'
           EXPORTING
                fieldname    = 'WAERS'
                tabname      = 'TCURT'
           IMPORTING
                select_value = p_waers.
    *--- get long text for the selected currency
      SELECT SINGLE ltext FROM tcurt
        INTO dyfields-fieldvalue
        WHERE spras = sy-langu
        AND   waers = p_waers.
      IF sy-subrc <> 0.
        CLEAR dyfields-fieldvalue.
      ENDIF.
    *--- update another field
      dyfields-fieldname = 'P_LTEXT'.
      APPEND dyfields.
      CALL FUNCTION 'DYNP_VALUES_UPDATE'
           EXPORTING
                dyname     = sy-cprog
                dynumb     = sy-dynnr
           TABLES
                dynpfields = dyfields.
    *-----------------------------------------------------------------------
    
    *--- Example of reading value of another field -------------------------
    
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_ktext.
    *--- read another field
      CLEAR: dyfields[], dyfields.
      dyfields-fieldname = 'P_WAERS'.
      APPEND dyfields.
      CALL FUNCTION 'DYNP_VALUES_READ'
           EXPORTING
                dyname     = sy-cprog
                dynumb     = sy-dynnr
           TABLES
                dynpfields = dyfields.
      READ TABLE dyfields INDEX 1.
    *--- get short text and update current field
      SELECT SINGLE ktext FROM tcurt
        INTO p_ktext
        WHERE spras EQ sy-langu
        AND   waers EQ dyfields-fieldvalue.
    *-----------------------------------------------------------------------
    
    
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_name.
    
      REFRESH value_tab[].
      REFRESH field_tab[].
      REFRESH return_tab[].
      field_tab-fieldname = 'ERNAM'.
      field_tab-tabname = 'VBAK'.
      APPEND field_tab.
      value_tab-name = 'John'.
      APPEND value_tab.
      value_tab-name = 'Abraham'.
      APPEND value_tab.
      value_tab-name = 'Lingam'.
      APPEND value_tab.
    
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield        = field_tab-fieldname
           TABLES
                value_tab       = value_tab
                field_tab       = field_tab
                return_tab      = return_tab
           EXCEPTIONS
                parameter_error = 1
                no_values_found = 2
                OTHERS          = 3.
      IF sy-subrc = 0.
        p_name = return_tab-fieldval.
      ENDIF.
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 11:27 AM

    hi,

    try this

    tables : mara,mchb,marc,lips.

    selection-screen : begin of block blk1 with frame title text-001.

    parameters :p_matnr LIKE mara-matnr OBLIGATORY ,

    p_charg LIKE mchb-charg OBLIGATORY,

    p_werks LIKE marc-werks OBLIGATORY,

    p_vbeln LIKE LIPS-vbeln .

    selection-screen : end of block blk1.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vbeln.

    SELECT * FROM lips CLIENT SPECIFIED INTO CORRESPONDING FIELDS OF TABLE p_it_values

    WHERE mandt = sy-mandt

    AND werks = p_werks

    AND matnr = p_matnr

    AND charg = p_charg.

    loop at p_it_values.

    write :/ p_it_values.

    endloop.

    <b><REMOVED BY MODERATOR></b>

    Message was edited by:

    Vinutha YV

    Message was edited by:

    Alvaro Tejada Galindo

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 07, 2007 at 12:23 PM

    Hi,

    Try like this

    p_matnr LIKE mara-matnr OBLIGATORY ,

    p_charg LIKE mchb-charg OBLIGATORY,

    p_werks LIKE marc-werks OBLIGATORY,

    p_vbeln LIKE LIPS-vbeln 'delivery number

    remove the below statement.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vbeln.

    start-of-selection.

    PERFORM get_values.

    FORM get_values .

    SELECT * FROM lips INTO CORRESPONDING FIELDS OF TABLE p_it_values

    WHERE mandt = sy-mandt

    AND werks = p_werks

    AND matnr = p_matnr

    AND charg = p_charg.

    Regards,

    Nagaraj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 10:47 PM

    You should perform your code in the START-OF-SELECTION event instead of AT SELECTION-SCREEN ON VALUE-REQUEST...

    Also, why are you using CLIENT SPECIFIED in your SELECT

    and then having WHERE mandt = sy-mandt?

    You should use CLIENT SPECIFIED only when necessary, when the client is something other than sy-mandt. It is not needed here.

    Leaving it out will make your code simpler, and easier to read.

    START-OF-SELECTION.
    
    PERFORM get_values.
    
    FORM get_values.
    
      SELECT * FROM lips 
        INTO CORRESPONDING FIELDS OF TABLE p_it_values
        WHERE werks = p_werks
          AND matnr = p_matnr
          AND charg = p_charg.
    
    
    etc
    
    ENDFORM.

    Good luck

    Brian

    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.