Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to pass the field value from module pool program to smartform using submit?

Former Member
0 Likes
1,726

// AT pai of module pool pgm i entered the following: here gv_orderid is my value to be available at smart form(driver pgm) & zmusic_store_smf is the driver program of my smartform.

gv_orderid= wa-itemid./

SUBMIT ZMUSIC_STORE_SMF VIA SELECTION-SCREEN

                              WITH p_order = gv_orderid

                              AND RETURN.

//AT driver pgm(zmusic_store_smf😞

START-OF-SELECTION.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
      formname                 = 'ZMUSIC_SMARTFORM1'
*   VARIANT                  = ' '
*   DIRECT_CALL              = ' '
   IMPORTING
     fm_name                  = lv_form
   EXCEPTIONS
     no_form                  = 1
     no_function_module       = 2
     OTHERS                   = 3.
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
CALL FUNCTION lv_form
   EXPORTING
*      iv_orderid = is_purchase_item-zorder_id.
iv_orderid = gv_orderid.

// here i'm trying to call my smartform('ZMUSIC_SMARTFORM1')  from this driver pgm but unable to access the value of gv_orderid please help me out with this.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,148

CALL FUNCTION lv_form

   EXPORTING

*      iv_orderid = is_purchase_item-zorder_id.

iv_orderid = p_order.

You have to declare the parameter as an import parameter of the Smartforms (Global data, Form interface) so it will be created as an import parameter of the generated Function Module.

Read some online documentation at help.sap.com like Using Parameters in a Form in  Smart Forms.

Regards,

Raymond

5 REPLIES 5
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,148

You have to declare the parameter as an import parameter of the Smartforms (Global data, Form interface) so it will be created as an import parameter of the generated Function Module.

Read some online documentation at help.sap.com like Using Parameters in a Form in  Smart Forms.

Regards,

Raymond

Read only

muneshpatwari
Active Participant
0 Likes
1,148

Hi,

In the PAI module, you are passing GV_ORDERID to P_ORDER, which seems to be a parameter of the driver program.

Is the parameter P_ORDER getting populated?

In the smartform, you seem to be passing GV_ORDERID.

Are you populating GV_ORDERID with the P_ORDER inside the main driver program??

Regards,

Munesh.

Read only

Former Member
0 Likes
1,149

CALL FUNCTION lv_form

   EXPORTING

*      iv_orderid = is_purchase_item-zorder_id.

iv_orderid = p_order.

Read only

0 Likes
1,148

Declare the gv_orderid in modulepool program.

And Declare the parameter as import parameter in smartform.

CALL FUNCTION  lv_form

   EXPORTING

*   ARCHIVE_INDEX              =

*   ARCHIVE_INDEX_TAB          =

*   ARCHIVE_PARAMETERS         =

*   CONTROL_PARAMETERS         =

*   MAIL_APPL_OBJ              =

*   MAIL_RECIPIENT             =

*   MAIL_SENDER                =

*   OUTPUT_OPTIONS             =

*   USER_SETTINGS              = 'X'

     i_input                    =  gv_orderid

* IMPORTING

*   DOCUMENT_OUTPUT_INFO       =

*   JOB_OUTPUT_INFO            =

*   JOB_OUTPUT_OPTIONS         =

* EXCEPTIONS

*   FORMATTING_ERROR           = 1

*   INTERNAL_ERROR             = 2

*   SEND_ERROR                 = 3

*   USER_CANCELED              = 4

*   OTHERS                     = 5

           .

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,148

Also analyze


SUBMIT ZMUSIC_STORE_SMF VIA SELECTION-SCREEN

                              WITH p_order = gv_orderid

                              AND RETURN.

gv_orderid is field name in module pool, p_order is field name in smartforms driver program, iv_orderid is fieldname in smartform signature.

Regards,

Raymond