cancel
Showing results for 
Search instead for 
Did you mean: 

Driver Program for Smartform with INPUT PARAMETER

Former Member
0 Kudos

Hi GURUS / EXPERTS,

I have created a smart form with input parameter at GLOBAL SETTING - Form Interface - Import Tab

DOCUMENT TYPE MSEG-MBLNR.

Defined the table u2013 on TABLE tab as u2013 ITAB LIKE MSEG & WA LIKE MSEG.

At MAIN WINDOW:

Added a PROGRAM LINE: On General Attribute mentioned INPUT PARAMETER - DOCUMENT & OUTPUT PARAMETER as ITAB. Written the select statement u2013

select msegmatnr msegcharg msegmenge msegmeins msegebeln mseglifnr maktmaktx into corresponding fields of table itab from mseg inner join makt on msegmatnr = maktmatnr where msegmblnr = document.

Added a Table and on DATA TAB mentioned the loop as

ITAB INTO WA

Added a TEXT and mentioned fields as

DOCUMENT: &WA-MBLNR&

MAT.COD: &WA-MATNR&

BATCH: &WA-CHARG&

QTY: &WA-MENGE& &WA-MEINS&

PO/VENDR: &WA-EBELN& / &WA-LIFNR&

CREATED A DRIVER PROGRAM as:

Now, I want to create a Driver Program for this smart form u2013 Where I want to put GRN No. as INPUT PARAMETER as u201CDOCUMENTu201D to call That SMART FORM.

What should I Do.?

Thanks in Advance.

DSC

Accepted Solutions (1)

Accepted Solutions (1)

raymond_giuseppi
Active Contributor

Call SMARTFORMS and display the form, in the menu : Environment, Function module name, copy this value

In your driver program use this FM as a pattern to get the correct call parameters. Then, before this call, add a call to FM SSF_FUNCTION_MODULE_NAME which will return in a variable (fm_name) the name of the generated FM (will be diferrent in different systems) Replace the name of the previously ied FM called with this parameter.

Ref : [Integrating the Smart Form into the Application|http://help.sap.com/saphelp_nw70/helpdata/en/1c/f40c5bddf311d3b574006094192fe3/frameset.htm]

Regards,

Raymond

Former Member
0 Kudos

Mr. Raymond Giuseppi ,

Thanks for your reply. MY FUNCTION MODULE NAME IS: /1BCDWB/SF00000039.

I have written following codes n driver program. But when I execute it gives an ABAP Error -

CALL_FUNCTION_PARM_MISSING

CX_SY_DYN_CALL_PARAM_MISSI

16.12.2010 at 21:02:14

Error analysis:

An exception occurred. This

below. The exception, assign

not caught, which

led to a runtime error. The

When calling the function mo

needed according to the inte

This parameter was "ITAB".

Codes: are

report GRN line-size 125.

data: begin of wa,

WERKS like MSEG-WERKS,

LGORT like MSEG-LGORT,

ZEILE like MSEG-ZEILE,

MBLNR like MSEG-MBLNR,

MATNR like MSEG-MATNR,

CHARG like MSEG-CHARG,

MENGE like MSEG-MENGE,

MEINS like MSEG-MEINS,

EBELN like MSEG-EBELN,

LIFNR like MSEG-LIFNR,

GJAHR like MSEG-GJAHR,

SGTXT like MSEG-SGTXT,

end of wa,

itab like table of wa.

data fm_name type RS38L_FNAM .

parameters: DOCUMENT like MSEG-MBLNR obligatory.

select MSEGZEILE MSEGMATNR MSEGCHARG MSEGMENGE MSEGMEINS MSEGEBELN

MSEGLIFNR MSEGLGORT MSEG~SGTXT into

corresponding fields of table itab FROM MSEG

where MSEG~MBLNR = DOCUMENT.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'ZBARCODE02'

IMPORTING

FM_NAME = fm_name

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.

exit.

ENDIF.

CALL FUNCTION fm_name

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

DOCUMENT = DOCUMENT

  • G_CARRID = <variable>

  • G_CONNID = <variable>

  • G_FLDATE = <variable>

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

TABLES

WA = ITAB

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

exit.

ENDIF.

Please Suggest. Where I am Wrong.

Sorry for Pasting a big code.

DSC

brad_bohn
Active Contributor
0 Kudos

What is the name of your table in your interface? You specified 'WA' but it must be 'ITAB'. How is it defined in the interface - do you also have a DDIC structure which is the same as your program definition? You need to make your defintions more user friendly - generic 'WA' and 'ITAB' are not good naming standards...

raymond_giuseppi
Active Contributor
0 Kudos

When you used ./1BCDWB/SF00000039 as a pattern, only some fields were commented do not comment any field, but fill them, and do not rename any parameter.

Was not the formal table parameter name "ITAB" and not "WA" ?

Regards,

Raymond

Former Member
0 Kudos

Dear Mr. Brad & Raymond,

I have Defined the table u2013 GLOBAL SETTING-Form Interface-TABLE tab as u2013 ITAB LIKE MSEG & WA LIKE MSEG.

When I execute the smartform , It shows the function module /1BCDWB/SF00000039. and ask for Input parameter i.e. DOCUMENT. After providing the document no. it show the report perfectly.

After that I have written a Driver program, and I am sure in driver program, I am making a error but where - I don't know.

This is the reason I have pasted the code of driver program and also mentioned the steps (of form designing).

Please mark the area where I am making the mistakes or change the codes.

I am totally new for smart forms.

With thanks & Regards,

DSC

raymond_giuseppi
Active Contributor
0 Kudos

When you test the smartfotms the program generates dummy parameters to execute the FM. You too must provide those in the drivers. You need one or two table parameters if I undestand what you wrote:

CALL FUNCTION fm_name
     EXPORTING
          document         = document
     TABLES
          itab             = it_itab
          wa               = it_wa
     EXCEPTIONS
          formatting_error = 1
          internal_error   = 2
          send_error       = 3
          user_canceled    = 4
          OTHERS           = 5.

But you wrote later that you filled those table yourself (select into itab). So remove itab from tab "table" of "Form interface" tab and move it to "global data" of "global definition".

Regards,

Raymond

Former Member
0 Kudos

Dear Mr. Raymond,

Thanks for your support.

Problem solved. Points has been assigned.

Once again thanks.

DSC

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Gurus / Experts,

Please help me.

DSC