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

module pool development

Hi Experts,

i am developing a module pool programing, in that am displaying two grids(header and item) as shown in attachment.problem is whenever i entered the values in header grid, it should automatically display at the item level. for ex if i entered the value "XYZ", it should automaticaly display in item level with value "XYZ".

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Dec 20, 2013 at 12:10 PM

    Where is the second ALV grid ?

    Regards,

    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

    • So there is only one ALV...

      • In the PAI of the dynpro, just append data input of upper dynpro in the internal table displayed in the ALV grid.
      • In the PBO of the dynpro, just after the code which initialize the ALV grid (with a check like if ref_grid IS INITIAL) use an alternative (ELSE) to execute the refresh of the grid
      IF gv_grid_displayed IS INITIAL.
      * First display
      CREATE OBJECT: gv_cont_exporting container_name = 'CONTAINER_NAME',
      gv_grid EXPORTING i_parent = cont_0201.
      CALL METHOD gr_grid->set_table_for_first_display
      EXPORTING
      is_layout = gs_layout
      is_variant = gs_variant
      i_save = 'A'
      i_default = 'X'
      CHANGING
      it_fieldcatalog = gt_fcat
      it_outtab = gt_itab
      gv_grid_displayed = abap_true.
      ELSE.
      * Next calls
      CALL METHOD gv_grid->refresh_table_display
      EXPORTING
      is_stable = gs_stable
      i_soft_refresh = 'X'
      EXCEPTIONS
      finished = 1
      OTHERS = 2.
      ENDIF.


      Regards,

      Raymond

  • author's profile photo Former Member
    Former Member
    Posted on Dec 25, 2013 at 11:52 PM

    if you use the same structure for both places to display (what should be your practise), then the value will be automatically copied after an enter or any other action on the dynpro

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 26, 2013 at 05:32 AM

    HI,

    PLEASE DO AS BELOW ...

    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.

    LOOP AT GT_VBAP INTO GS_VBAP1 WITH CONTROL ITEM CURSOR
    ITEM-CURRENT_LINE.
    ENDLOOP.
    *
    PROCESS AFTER INPUT.
    LOOP AT GT_VBAP.
    ENDLOOP.

    MODULE USER_COMMAND_0100.

    CHAIN.
    FIELD : GS_VBAP-POSNR,GS_VBAP-MATNR,GS_VBAP-QUANT.
    ENDCHAIN.



    pbo


    *& Module STATUS_0100 OUTPUT
    *&---------------------------------------------------------------------*
    * text
    *----------------------------------------------------------------------*
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'STAT'.
    * SET TITLEBAR 'xxx'.

    *REFRESH GT_VBAP.

    MOVE-CORRESPONDING GS_VBAP TO GS_VBAP1.

    APPEND GS_VBAP1 TO GT_VBAP.
    CLEAR GS_VBAP1.
    DELETE GT_VBAP WHERE POSNR IS INITIAL.

    ENDMODULE. " STA



    pai


    *----------------------------------------------------------------------*
    ***INCLUDE MZSP_MOD_TEST_PAI .
    *----------------------------------------------------------------------*
    *&---------------------------------------------------------------------*
    *& Module USER_COMMAND_0100 INPUT
    *&---------------------------------------------------------------------*
    * text
    *----------------------------------------------------------------------*
    MODULE USER_COMMAND_0100 INPUT.

    CASE SY-UCOMM.
    WHEN 'BACK' OR 'CANCEL' OR 'EXIT'.
    LEAVE TO SCREEN '0'.
    ENDCASE.

    ENDMODULE.



    TOP INCLUDE


    PROGRAM SAPMZSP_MOD_TEST.


    TYPES : BEGIN OF TY_VBAP,
    POSNR TYPE POSNR_D,
    MATNR TYPE MATNR,
    QUANT TYPE MENGE_D,
    END OF TY_VBAP.

    DATA : GT_VBAP TYPE TABLE OF TY_VBAP,
    GS_VBAP TYPE TY_VBAP,
    GS_VBAP1 TYPE TY_VBAP.

    CONTROLS : ITEM TYPE TABLEVIEW USING SCREEN 100.







    Capture.PNG (32.2 kB)
    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.