Can it is possible to call two smartforms using single program.

i am doing identification tag form. i wanted to display the output of program seperate for accepted qty. and rejected qty.By running program only one time.

Hello!
We made this code at a customer to call several different SAMRTFORMS from the printer program, like this.
* SmartForm from customizing table TNAPR
  IF NAST-LDEST <> 'ZEP2' and NAST-LDEST <> 'ZEPH'.
    LF_FORMNAME = TNAPR-SFORM.
  ELSE.
    IF NAST-KSCHL = 'LD00'.
      LF_FORMNAME = 'ZSMARTFORM1'.
    ELSEIF NAST-KSCHL = 'LD99'.
      LF_FORMNAME = 'ZSMARTFORM2'.
    ELSE.
      LF_FORMNAME = TNAPR-SFORM.
    ENDIF.
  ENDIF.
...Additional program lines...
* determine smartform function module for delivery note
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
         EXPORTING  FORMNAME           = LF_FORMNAME
*                 variant            = ' '
*                 direct_call        = ' '
         IMPORTING  FM_NAME            = LF_FM_NAME
         EXCEPTIONS NO_FORM            = 1
                    NO_FUNCTION_MODULE = 2
                    OTHERS             = 3.
    IF SY-SUBRC <> 0.
*   error handling
      CF_RETCODE = SY-SUBRC.
      PERFORM PROTOCOL_UPDATE.
    ENDIF.
  ENDIF.
Regards
Tamá

Similar Messages

  • How to call two smartforms with using a single print program

    Hi,
       I have a requirement wherein I need to call two smartforms using a single print program.
       The interface parameters are different in two smartforms.
       I presently solved the issue using the smartform names as the reference.
       Can anyone let me know if there is any other way to solve it.
       I heard something about global params. But not sure.
       Please let me know the best possible way to solve this issue.
    Thanks and Regards,
       Debabrata

    Hi Debabrata,
    Based on the condition in your print program you can call the below code
    fname1 TYPE rs38l_fnam.
    IF -
    call function 'SSF_FUNCTION_MODULE_NAME'
      exporting
        formname                 = 'ZSMARTFORMS'
    importing
       fm_name                  = fname1
    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 FNAME
    EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB      =
      ARCHIVE_PARAMETERS =
      CONTROL_PARAMETERS=
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT              =
      MAIL_SENDER                 =
      OUTPUT_OPTIONS           =
      USER_SETTINGS             = 'X'
    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
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ELSE.
    fname2 TYPE rs38l_fnam.
    call function 'SSF_FUNCTION_MODULE_NAME'
      exporting
        formname                 = 'ZSMARTFORMS'
    importing
       fm_name                  = fname2
    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 FNAME
    EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB      =
      ARCHIVE_PARAMETERS =
      CONTROL_PARAMETERS=
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT              =
      MAIL_SENDER                 =
      OUTPUT_OPTIONS           =
      USER_SETTINGS             = 'X'
    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
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDIF.

  • Calling two smartforms in one Abap program

    Hi ABAPers,
    Can anybody know how to call 2 smartforms in 1 abap program?actually i used the FM SSF_FUNCTION_MODULE_NAME...and two smart forms are called...but my main problem is...the first smartforms is called and the print dialog box appeared...once i click the button back ...the second smartforms is called and print dialog box appeared again..
    I want to correct this...i want this  to be happen once i click the print button...the two smart forms will be combined in a one printing...meaning the first page is the first smartforms and the next page will be the second smart forms...no matter how many pages will be the first smartforms...the second smartforms will concatenate or will append to the last page of the first smartforms..how can i do this?
    Please help...this is my sample code..kindly correct the error.
    Will reward points...
    suppressing the dialog box****************************
        outop-tddest = 'LP01'.
        cparam-no_dialog = 'X'.
        cparam-preview = space.
        cparam-getotf = 'X'.
    Call the First Smartforms *******************
       CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
          EXPORTING
            formname           = 'ZSF_CHEQUE'
          IMPORTING
            fm_name            = ly_formname
          EXCEPTIONS
            no_form            = 1
            no_function_module = 2
            OTHERS             = 3.
        CALL FUNCTION ly_formname
          EXPORTING
            prepared_by      = p_prepb
            approved_by      = p_apprb
          TABLES
            it_cheque        = it_final
          EXCEPTIONS
            formatting_error = 1
            internal_error   = 2
            send_error       = 3
            user_canceled    = 4
            OTHERS           = 5.
    Call the Second Smartforms *******************
          CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
          EXPORTING
            formname           = 'ZSF_TSHEET'
          IMPORTING
            fm_name            = ly_formname
          EXCEPTIONS
            no_form            = 1
            no_function_module = 2
            OTHERS             = 3.
        CALL FUNCTION ly_formname
          EXPORTING
            prepared_by      = p_prepb
            approved_by      = p_apprb
          TABLES
            it_cheque        = it_final
          EXCEPTIONS
            formatting_error = 1
            internal_error   = 2
            send_error       = 3
            user_canceled    = 4
            OTHERS           = 5.
    Thanks in advance
    aVaDuDz

    hi,
    i never used these function but i've found this link.
    [http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/62ae7fcd-0b01-0010-3e9d-a54f26944450]
    [http://help.sap.com/saphelp_nw2004s/helpdata/en/64/bf2f12ed1711d4b655006094192fe3/content.htm]
    [http://help.sap.com/saphelp_nw04/helpdata/en/64/bf2f12ed1711d4b655006094192fe3/frameset.htm]
    [SMartform printing;
    hope that is useful.
    bye
    Marco
    Edited by: nicolai marco on Jan 14, 2008 12:36 AM

  • Can we call multiple Smartforms from single Driver Prog?

    Hi all,
    Can we call multiple smartforms from single Driver Program. Here Driver program is custom Program.
    I want to give Print Parameter only once and output should get printed one after the another smartform in same order of smarforms were called.
    If yes, then how?
    Thanks in advance.

    Yes, you can do this in your Smartform driver program.
    Each time you call you Smartform function module you will need to change the values in structure OUTPUT_OPTIONS slightly.
    On the first call set TDNEWID to X.
    After this, set it to space
    On the last form set TDFINAL to X.
    This will put all of the output into one spool request, in the order they are called in the program.
    Regards,
    Nick

  • I have to print two labels using single XML file.Error:Only one top level e

    Hi,
    I have to print two labels using single XML file. But its giving error:
    [Error] Error -1072896683 - Line: 38 Pos: 2 Error: Only one top level element is allowed in an XML document.
    Below is my XMl file:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE labels SYSTEM "label.dtd">
    <labels FORMAT="lib://FRD/PurchasedDoor.btw"  PRINTERNAME="IBM 6700-R80 (300 dpi)" _QUANTITY="1">
    <label>
    <variable name= "Color">AUTUMN</variable>
    <variable name= "Special_Message_Attribute">MSG*</variable>
    <variable name= "Special_Message">This is special Message Label</variable>
    <variable name= "Model"></variable>
    <variable name= "Build_Date">09-APR-12</variable>
    <variable name= "Assy_Cart"></variable>
    <variable name= "Assy_Slot"></variable>
    <variable name= "Finish_Cart"></variable>
    <variable name= "Finish_Slot"></variable>
    <variable name= "Serial_Number">1945.1.1.2-1</variable>
    <variable name= "Serial_Number_Barcode">1945.1.1.2-1</variable>
    <variable name= "Specie">BIRCH</variable>
    <variable name= "Truck_Group"></variable>
    <variable name= "Label_Sequence_No">1</variable>
    <variable name= "WIP_Cart"></variable>
    <variable name= "WIP_Slot"></variable>
    <variable name= "Cabinet_Sequence_No">110</variable>
    <variable name= "JC"></variable>
    <variable name= "Thickness"> </variable>
    <variable name= "Width"> </variable>
    <variable name= "Length"> </variable>
    <variable name= "Overlay"></variable>
    <variable name= "Options">B30</variable>
    <variable name= "Profile_No"></variable>
    <variable name= "Door_Style">NEWBERRY</variable>
    <variable name= "Glaze"></variable>
    <variable name= "Shape"></variable>
    <variable name= "Glass"></variable>
    <variable name= "Hinge_Side"></variable>
    <variable name= "Hinge_Type"></variable>
    <variable name= "EGE"></variable>
    </label>
    <labels FORMAT="lib://FRD/SpecialMessage.btw"  PRINTERNAME="IBM 6700-R80 (300 dpi)" _QUANTITY="1">
    <label>
    <variable name= "Serial_Number">1945.1.1.2-1</variable>
    <variable name= "Special_Message">This is special Message Label</variable>
    <variable name= "Cabinet_Sequence_No">110</variable>
    </label>
    </labels>
    Please suggest.

    >
    XML can only have one root element per file.
    >
    from XML Document: The Root Element

  • Call two smartforms from two different print programs

    Hi Sapiens,
      I have a requirement that there are two different smartforms and they have there independent print programs.
      Just wanted to know weather is it possible in SAP to merge those to smartforms and there print programs so that first smartform is displayed first and second smartform is printed at its back(duplex printing).
    Regards
    Milind

    Hi,
    You can use submit program in the first program to call the second program and
    fetch the required interface data related to the second smartform and once u have the interface data
    for both the programs then u can merge the both smartforms data and display them as one layout instead of displaying the two layouts in different formats.
    For merging of data of both the smartforms u can do :Convert the output of first smartform into OTF format data then convert the data of second smartform into OTF table and append it to the first table .
    Now u have the data of both the smartforms in one table then convert this OTF data into PDF format and create a spool request with the combined forms data.
    Thanks,
    M.Naveen Kumar.

  • Is it possible to call c# dll using JNI

    Using JNI we can invoke native code written in c or c++.
    Steps:
    1) All we have to do is write a class and have a method of type native.
    2) Invoke javah with -jni option to create a .h file.
    3) Include this header file and implement the method in c or c++ code.
    Now my question is:
    Is it possible to call I want to know whether we can implement the native method in c# instead of c or c++.
    Thanks

    No you can't, but you can have the JNI C/C++ code call C# code. How to do that is no longer a JNI question but a C# question.

  • Calling two  BAPIs from single input field from Webdynro for ABAP

    Hi experts ,
    here i hve a small problem .
    i hve two BAPIs , both  having olly one import parameter and hving messages as the export parameters .
    so how i hve to call them , give the correct method .
    thanks in advance
    setu

    Refer to this thread
    How to call two Bapi with same inputfield in webdynpro application

  • Can i play a game between two ipads using bluetooth

    Can I play games betwwen two ipads using bluetooth

    It depends on the game. The app has to be specifically written to allow play between two devices via Bluetooth.
    Regards.

  • How to pass a pointer in labview library call function by using dll programmed in Labwindows​?

    Hi,
    I'm trying to interface a camera with Labview.  However, the camera can only be programmed by C, so I'm using Labwindow CVI.
    I need to pass a camera handle from one function to another, eg. from a opencamera function to setparameter function.  
    /* Load the Qcam driver and Open the First Camera */
    void DLLEXPORT LoadDriverAndOpenCamera()
    QCam_CamListItem cameraList[10];
    unsigned long cameraListLength=sizeof(cameraList)/sizeof(cameraL​ist[0]);
    //load the driver
    QCam_LoadDriver();
    //get a list of the cameras
    QCam_ListCameras(cameraList,&cameraListLength);
    //listLength is now the number of cameras available
    QCam_Handle hCam;
    //Open the first camera in the list
    QCam_OpenCamera(cameraList[0].cameraId, &hCam);
    Apparently, caemraId is an unsigned long (unsigned 32-bit in Labview 2012 32-bit? ) and QCam_Handle is defined as void*, so it's a pointer that points to an unsigned 32-bit.
    When I only use C for programming, I can pass hCam variable to other functions as long as it's declared as global variable.  Ex, the next function can be void SetParameter(QCam_Handle hCam).  However, here I'm trying to make a dll by Labwindows/CVI and then call LoadDriverAndOpenCamera() function through library call in Labview.  
    My question is:  How can I pass hCam to other functions in the same dll?  Do I have to add paramter to the function? For example:
    void DLLEXPORT LoadDriverAndOpenCamera(unsigned long cameraId, QCam_Handle* cameraHandle)
    And then add two lines:
    cameraId=cameraList[0].cameraId;
    cameraHandle=hCam;
    into the function?  Then I can pass cameraHandle out?  However, hCam will still have void* type.
    Even if that's the case, how can I set up library call node on Labview?  In the arg parameter set up, I don't see pointers?  It seems I cannot set up an output node to be a pointer that points to a unsigned long.
    Thank you very much for your help!
    Best,
    Charles
    Solved!
    Go to Solution.

    Hello Charles, 
    I noticed you posted a similar question here. do you have any further questions about using the call library function node? 
    Haley N
    Applications Engineer
    National Instruments

  • Calling Smart Form using Driver Program

    Hi, I'm a new ABAP developer. I've recently been studied about Smart Forms and I didn't understand what are the benefits to call a smart form using driver program.
    Could anyone help me, please?

    Bruno, it works like this.
    Lets says you attach a Z output to a sales order which sends the details of the SO to the customer in a PDF format. For this purpose you have developer the o/p using smartforms or scripts. Now there are few configs that you will perform in order to send the PDF to the customer AUTOMATICALLY once the SO is saved. This is done thru the transaction NACE where you will attach the smartform, the o/p, partner function and driver program.
    This driver program will get kicked in when the order is saved and will perform the logic and then call the smartform.
    Hope this give a little bit better picture.
    Vikram.M

  • How to print one sales order output from two printers using single command.

    Dear all,
    Our requirement is to print single sales order from two different printers, where as one printout for sales order output and another for sales order cash receipt.
    We developed two smartforms for both outputs.
    But we are struggling to assign the smartforms to single document type, which has to result two printouts after saving the sales order.
    Please help us to solve the issue.
    Your suggestions will be highly appreciated.
    Best regards
    Raghu ram

    Hi,
    You should define two different output type for your requests, one is for SO output, the other is for SO cash receipt. That's okay!
    Good luck
    Z.T

  • How to Move file / call UNIX command using ABAP Program

    Hi, ABAP Guru.
    I need to Cut & Paste file (Move file from one location to another location) on Network Shared Drive using ABAP program.
    But I can't figured out how to do this and what ABAP Command / FM / Method (and maybe UNIX command) that being used.
    Please give me the advice.
    Best regard and Thank you all.
    Nattapash C.

    all methods for your requirements should be in class CL_GUI_FRONTEND_SERVICES

  • How can I remove all content between two tags using Find/Replace regular expressions?

    This one is driving me bonkers...  I'm relatively new to regular expressions, but I'm trying to get Dreamweaver to remove all content between two tags in an XML document.  For example, let's say I have the following XML:
    <custom>
    <![CDATA[<p>Some text</p>
    <p>Some more text</p>]]>
    </custom>
    I'd like to do a Find/Replace that produces:
    <custom>
    </custom>
    In essence, I'd like to strip all of the content between two tags.  Ideally, I'd like to know how to strip the CDATA content as well, to return the following:
    <custom>
    <![CDATA[]]>
    </custom>
    I'd much appreciate any suggestions on accomplishing this.
    Many thanks!

    Thanks much for your response.  I found David's article to be a little thin with respect to examples using quantifiers in coordination with the wildcard metacharacters; however, I was able to cobble together a working expression through trial and error using the information he presented.  For posterity, here’s the solution:
    Find:
    <custom>[\d\D]*?</custom>
    Replace:
    <custom>
    <![CDATA[]]>
    </custom>
    I believe this literally translates to:
    [] = find anything in this range/character class
    \d = find any digit character (i.e. any number)
    \D = find any non-digit character (i.e. anything except numbers)
    *? = match zero or more times, but as few times as possible (i.e. match multiple characters per instance, but only match one instance at a time, or none at all)
    I’m still not sure how to effectively utilize the . wildcard.  For example, the following expression will not find content that ends with a number:
    <custom>.*?[\D]*?</ custom >
    I'm presuming this is because numbers aren't included in the \D metacharacter; however, shouldn't numbers be picked up by the .*? expression?

  • Comparasions of records between two dsos  using abap program

    Hello Experts,
                           As per my business requirements we Implemented  30 DSO (EDW Layer) for x Reason  with the reference from  Y Reason DSOs. and for x reson dso we created  transformations and dtp. through process chains we loaded the data to X Reason Dsos. after loading i want to comare these two dso records through  ABAP Progrm.
    here my source is : X Region Dsos
    here Trget is        :  Y Region Dsos
    these two are the mandatory fields
    and the optional fields are:
    1. Sales org
    2. Sales division
    3. document creation date.
      for this type of requirement i want to implement  ABAP Program.i want to abap code for this type of requirement. anyone  have abap code for similar type of requirement please send the abap code.
    Thanks & Regards,

    Hi saurabh,
    If your requirement if to comepare both the values based on the sales org, sales div, data, u can build a report or if you want to look up the both the DSO and want to perform any operation we need to write routine at transforamation level.
    I'm sending u a sample code where i had used for look up two ods and delete the exisitng saled docs.in the BI.
    DATA : BEGIN OF i_uxxx OCCURS 0,
           /bic/zaw        LIKE    /bic/aZD_UDLIT00-/bic/zaw,
           END OF i_uxxx.
    DATA : wa_udlit LIKE i_uxxxt.
    DATA : BEGIN OF i_uxxxx OCCURS 0,
           /bic/zaw        LIKE    /bic/aZD_UDAN00-/bic/zaw,
           END OF i_udxxx.
    DATA : wa_uxxxx LIKE i_uxxx.
    case 1 : For uxxxx lite data
    CLEAR i_uxxx.
        DATA: wa_srcpack  TYPE  tys_sc_1,
              zindex      TYPE  sy-tabix.
        BREAK-POINT.
    CLEAR: zindex.
        SELECT /bic/zaw
        FROM  /bic/aZD_UDLIT00
        INTO  TABLE i_uxxx.
        FOR ALL ENTRIES IN SOURCE_PACKAGE
        WHERE /bic/zaw  = SOURCE_PACKAGE-/bic/zcustomer.
        LOOP AT SOURCE_PACKAGE INTO wa_srcpack.
          zindex = sy-tabix.
          CLEAR wa_xxx.
          READ TABLE i_uxxx INTO wa_uxxx
                               WITH KEY /bic/zaw = wa_srcpack-/bic/zcustomer
          IF sy-subrc = 0.
            Delete SOURCE_PACKAGE.
          ENDIF.
       MODIFY SOURCE_PACKAGE INDEX zindex FROM wa_srcpack.
        CLEAR: zindex.
        ENDLOOP.
    *case 2 : For uxxxx data
    CLEAR i_uxxxx.
        DATA: wa_srcpack1  TYPE  tys_sc_1,
              zindex1      TYPE  sy-tabix.
        BREAK-POINT.
    CLEAR: zindex1.
        SELECT /bic/zaw
        FROM  /bic/aZD_UDAN00
        INTO  TABLE i_uxxxx
        FOR ALL ENTRIES IN SOURCE_PACKAGE
        WHERE /bic/zaw  = SOURCE_PACKAGE-/bic/zcustomer.
        LOOP AT SOURCE_PACKAGE INTO wa_srcpack1.
          zindex1 = sy-tabix.
          CLEAR wa_uxxx.
          READ TABLE i_uxxxx INTO wa_uxxx
                               WITH KEY /bic/zaw =
                               wa_srcpack1-/bic/zcustomer
          IF sy-subrc = 0.
            Delete SOURCE_PACKAGE.
          ENDIF.
       MODIFY SOURCE_PACKAGE INDEX zindex FROM wa_srcpack.
        CLEAR: zindex1.
    endloop.
    Hope this helps...
    Regards
    KP

Maybe you are looking for

  • Problem Facing in Mass Changes

    Hi, I am facing problem in Mass Transfer -----> Changes. When trying to set a new depreciation rule. The process completes normally 1. When Preview Report shows it shows the asset preview of changes of depriciation rule. 2. then Run Process completes

  • How to connect the UMI-7764 to a geared motor

    Please, I have simply to connect a geared motor to the UMI-7764 thru an L293D driver. Please, could you tell me which outputs of the UMI-7764 do I have to connect to the driver ? Thank you.

  • One USB port isn't working...

    Hey, I just realised that one of my USB ports isn't working when I plugged in my mouse... Should I be very concerned about this? I live in a really remote community (ie no stores anywhere closer than a 3 hour plane ride away) and can't bear the thoug

  • Conditionally Hide and Show a column in a template based on a column data

    Hi , We have an RTF template for Oracle iExpense Report. We have two types of Expense type . Business and Non-Business. We need to conditionally enable Host Country and Merchant Name if the Expense Type is Non- Business and hide the two columns if th

  • Sql loader loading data from legacy to Oracle

    Hi we have a requirement that we need to import data from legacy to oracle AR.We know that we need to put the data file in BIN folder,but I want to know about the data file source if we place in windows folder instead of BIN directory will SQL loader