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

Calling smartform in a background program

Former Member
0 Likes
1,858

Hi Experts,

I want to call one smartform in a background program, i am very new to smartform .Can anybody help me to do this?

I want to suppress the dialog box appearing while directly executing the smartform?

Also please tell me how i can give the smartform data to spool?

Regards,

Ratheesh

7 REPLIES 7
Read only

Former Member
0 Likes
1,089

Hello Friend,

Anyhow u write a driver program to call smartform using this Fm SSF_FUNCTION_MODULE_NAME

so u can run the report Back ground...

Thank u,

santhosh

Read only

Former Member
0 Likes
1,089

Hi,

To supress the dialog box appearing while directly executing the smartform you can do it by

setting the CONTROL PARAMETERS .

In this set control-no_dialog = 'X'.

then it will directly executes.

Regards,

jaya

Read only

0 Likes
1,089

Thanks for the rply,

My question is while executing the driver program, Does the printing will happen directly from the spool or not?

Regards,

Ratheesh

Read only

Former Member
0 Likes
1,089

Hi Ratheesh,

Kindly go through this link below:

Hope it helps.

Regrds

Mansi

Read only

Former Member
0 Likes
1,089

Hi,

in the driver program change the user settings to SPACE,it will work.

Regards,

jaya

Read only

0 Likes
1,089

Hi,

I tried using No dialog = 'X' and user setting = ' ' ,but still the dialog box is appearing.

Can you please help?

Regards,

Ratheesh

Read only

Former Member
0 Likes
1,089

Hi Ratheesh,

First you create Form . in print program you have to read the data from data bace table table "nast". and Based on the NAST-OBJKY retrive your data.

 DATA : RETURN_CODE TYPE SY-SUBRC,
       US_SCREEN TYPE C,
       P_ORDER LIKE NAST-OBJKY.

DATA: RETCODE   LIKE SY-SUBRC.         "Returncode
DATA: XSCREEN(1)  TYPE C.              "Output on printer or screen
DATA: REPEAT(1) TYPE C.
DATA : LT_TEXT LIKE TLINE-TDLINE.


  CLEAR RETCODE.
  XSCREEN = US_SCREEN.
  SELECT SINGLE *
                 FROM NAST INTO NAST WHERE OBJKY = NAST-OBJKY.  "P_VBELN.
  PERFORM GET_DATA.
  CASE RETCODE.
    WHEN 0.
      RETURN_CODE = 0.
    WHEN 3.
      RETURN_CODE = 3.
    WHEN OTHERS.
      RETURN_CODE = 1.
  ENDCASE.

FORM GET_DATA .

  P_ORDER = NAST-OBJKY.

  SELECT VBELN
         AUDAT
         WAERK
         KUNNR
         VDATU
         FROM VBAK
         INTO TABLE TB_VBAK
         WHERE VBELN = P_ORDER.

  IF NOT TB_VBAK[] IS INITIAL.
    SELECT VBELN
           POSNR
           MATNR
           KWMENG
           NETPR
           NETWR
           BRGEW
           GEWEI
           VOLUM
           VOLEH
           CHARG
           WERKS
           POSEX
           KDMAT
           FROM VBAP
           INTO TABLE TB_VBAP
           FOR ALL ENTRIES IN TB_VBAK
           WHERE VBELN = TB_VBAK-VBELN.
  ENDIF.

endform. 

After complete this go through NACE transaction in that select required out put type and give you form name and Program name.

then go through the transaction in display mode and select the print preview. you will get your lay oput.

here You must give output type in proper.