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

Value not getting transported to another transaction in user-command.

Can anyone please suggest me why the below stateent is not working

When i execute the report and double click on an asset number then it is calling transaction as03 but the selected value is not transported to as03 kindly suggest me.

Below is the code what i have tried.

WA_FIELDCAT-COL_POS = 7.
WA_FIELDCAT-TABNAME = 'IT_FINAL'.
WA_FIELDCAT-FIELDNAME = 'BVAL'.
WA_FIELDCAT-SELTEXT_M = 'BOOK VALUE'.
WA_FIELDCAT-OUTPUTLEN = 15.
WA_FIELDCAT-DO_SUM = 'X'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.



WA_SORTINFO-FIELDNAME = 'ANLN1'.
APPEND WA_SORTINFO TO IT_SORTINFO.
CLEAR WA_SORTINFO.


CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
 EXPORTING
   I_CALLBACK_PROGRAM                = SY-REPID
   I_CALLBACK_USER_COMMAND           = 'TEST'
   I_GRID_TITLE                      = TITLE
   IT_FIELDCAT                       = IT_FIELDCAT
   IT_SORT                           = IT_SORTINFO
   I_DEFAULT                         = 'X'
  TABLES
    T_OUTTAB                          = IT_FINAL
 EXCEPTIONS
   PROGRAM_ERROR                     = 1
   OTHERS                            = 2
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

REFRESH IT_FIELDCAT.
CLEAR: WA_FIELDCAT.


form TEST using ucomm type sy-ucomm
           selfield type slis_selfield.

call function 'CONVERSION_EXIT_ALPHA_INPUT'
  exporting
    input         = selfield-value
 IMPORTING
   OUTPUT        =  wa_final-ANLN1
          .

read table it_final into wa_final with key anln1 = selfield-value.
call transaction 'AS03' ." and skip first screen.
  endform.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 13, 2011 at 08:33 AM

    You must pass the relevant parameters using SET PARAMETER ID.

    The parameter ids are attached to the screen fields. In this case:

    SET PARAMETER ID 'AN1' value (for asset)

    SET PARAMETER ID 'AN2' value (for sub number)

    SET PARAMETER ID 'BUK' value (for company code)

    CALL TRANSACTION 'AS03'

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 13, 2011 at 08:48 AM

    Some remarks

    - Read the internal table with the index provided in the received parameter

    - Check the field name for the drill down

    (In your sample, if user double-click on a character field, the conversion exit function module will raise an error)

    - The parameter ids must be set explicitly

    (Only input field of classical dynpro will update those memory values in PAI if the SET parameter and GET parameter checkboxes are checked.)

    The code could look like

    FORM user_command  USING r_ucomm LIKE sy-ucomm
                             rs_selfield TYPE slis_selfield.    "#EC CALLED
    * Function code
      CASE r_ucomm.
          " Double-click
        WHEN '&IC1'. " or subfield f2code of layout structure
          " Read current record
          CHECK rs_selfield-tabindex IS NOT INITIAL.
          READ TABLE it_final INTO wa_final INDEX rs_selfield-tabindex.
          " DrillDown depends on field name
          CASE rs_selfield-fieldname.
            WHEN 'ANLN1'.
              SET PARAMETER ID 'AN1' FIELD wa_final-anln1.
              SET PARAMETER ID 'AN2' FIELD wa_final-anln2.
              SET PARAMETER ID 'BUK' FIELD wa_final-bukrs.
              CALL TRANSACTION 'AS03' AND SKIP FIRST SCREEN.
            WHEN OTHERS. " other fields
          ENDCASE.
        WHEN OTHERS. " other function codes
      ENDCASE.
    ENDFORM.                    "TEST

    Regards,

    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 13, 2011 at 08:57 AM

    hi

    set parameter id is used to set the value in memory , using get parameter id you can get the data from that memory location

    standard data elements have assigned to these set and get parameters , if you want to check the memory location for a particular field double click on field name in further characteristics of that field you have a option called parameter id

    so using the statement set parameter id 'AUN' .else press f1 on set thenn you will get enough stuff.

    <removed by moderator>

    Regards

    Siva

    Edited by: Thomas Zloch on Dec 13, 2011 8:31 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 13, 2011 at 09:25 AM

    Hi,

    Write following code in perform

    Form TEST using ucomm type sy-ucomm

    selfield type slis_selfield.

    CASE UCOMM.

    WHEN '&IC1'. " for double click

    READ TABLE T_FINAL into WA_FINAL INDEX SELFIELD-TABINDEX .

    IF SY-SUBRC = 0.

    SET PARAMETER ID 'AN1' FIELD WA_FINAL-ANLN1. " Asset number

    SET PARAMETER ID 'AN2' FIELD WA_FINAL-ANLN2. "Asset subnumebr

    SET PARAMETER ID 'BUK' FIELD WA_FINAL-BUKRS. " Company code

    CALL TRANSACTION 'AS03'.

    ENDIF.

    Hope this helps.

    Thanks & Regards

    Tejaswini Khante

    ENDCASE.

    endform.

    Edited by: Tejaswini Khante on Dec 13, 2011 10:27 AM

    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.