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

Sample code to design a screen to retrieve details from MARA and display it

Hi,

Can anyone provide me a sample code to design a screen to retrieve details from MARA table and display them using DYNPRO.

Regards,

Prabhu

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Sep 10, 2007 at 01:14 PM

    Hi, what you need to do? An alv grid with container, a table control? Please, specific it.

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

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

    Hi Prabhu

    Do you want a control of the table MARA field by field?

    Regards

    Allan Cristian

    Add a comment
    10|10000 characters needed characters exceeded

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

    Hi,

    The output of a report should give a screen with "matnr" as parameter and a push button with text "Display". When I click the button display it should give details(matnr,mtart, ersda,ernam) about the input "matnr".

    Thanks,

    Prabhu

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi prabhu,

      You can use a list box with the "values" of the table in the same screen, like this:

      I create here e table with the name "ZMARA" with the same fields, modify it please.

      • Create a screen (like 100 for example)

      • Go to layout of the screen and insert the fields of the table mara - press F6 (Dictionary/program field window);

      • rename the input/output field (MATNR) to ZMARAMATNR and set the FctCODE to ZMARAMATNR too;

      You'll need 3 Module's and the "TOP".

      PROCESS BEFORE OUTPUT.

      MODULE STATUS_0100. (Status GUI at your choice)

      MODULE vrm_0100. (to use the ListBox)

      PROCESS AFTER INPUT.

      MODULE USER_COMMAND_0100. (to set the values of the fields to the IO fields at the screen)

      • TOP

      PROGRAM SAPMZMARA .

      TYPE-POOLS: vrm.

      tables: zmara.

      data: ivrm_values TYPE vrm_values,

      xvrm_values LIKE LINE OF ivrm_values,

      name TYPE vrm_id,

      ZMARAMATNR(20),

      ti_zmara type standard table of zmara with header line.

      MODULE vrm_0100 OUTPUT.

      select * from zmara into table ti_zmara.

      clear ivrm_values.

      name = 'ZMARAMATNR'.

      loop at ti_zmara.

      xvrm_values-key = ti_zmara-matnr.

      xvrm_values-text = ti_zmara-matnr.

      APPEND xvrm_values TO ivrm_values.

      endloop.

      CALL FUNCTION 'VRM_SET_VALUES'

      EXPORTING

      id = name

      values = ivrm_values.

      ENDMODULE. " vrm_0100 OUTPUT

      MODULE USER_COMMAND_0100 INPUT.

      if sy-ucomm = 'ZMARAMATNR'.

      read table ti_zmara with key MATNR = ZMARAMATNR.

      if SY-SUBRC = 0.

      ZMARA-MTART = ti_ZMARA-MTART.

      ZMARA-ERSDA = ti_ZMARA-ERSDA.

      ZMARA-ERNAM = ti_ZMARA-ERNAM.

      else.

      ZMARA-MTART = ''.

      ZMARA-ERSDA = ''.

      ZMARA-ERNAM = ''.

      endif.

      endif.

      ENDMODULE. " USER_COMMAND_0100 INPUT

      I'm looking for the parameters and I'll post here.

      Regards

      Allan Cristian

      Message was edited by:

      Allan Cristian

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.