How to concatenate in se38 and smartforms.

hi experts
     i m new in sap, so please help me out from my query regarding concatenate.
I have written code in se 38 by concatenating  2 fields and i am getting output . But now when i am using smartforms with se38, i am not getting output.
I think there is some problem in smartforms , because my code is correct.
so please provide me procedure for smartform.
MY GOAL is that-- i want 2 print output using smartforms and se 38.
this is my code.
TABLES: PAYR.
DATA: RESULT TYPE STRING..
DATA: GT TYPE STANDARD TABLE OF ZCONC,
      WA TYPE ZCONC.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS: V_BUKRS TYPE PAYR-ZBUKR.
PARAMETERS: YEAR    TYPE PAYR-GJAHR.
SELECTION-SCREEN END OF BLOCK B1.
START-OF-SELECTION.
  SELECT ZNME1
            CHECT
   INTO CORRESPONDING FIELDS OF TABLE GT
   FROM PAYR
   WHERE  PAYR~ZBUKR = V_BUKRS
   AND    PAYR~GJAHR = YEAR.
loop at gt into wa.
concatenate wa-znme1  wa-chect into result.
write: / result.
endloop.

thank u experts.
i have solved my problem
its actually i have to concantenate in smartform
so i have define a parameter in global defination
and in main area i have write a code concatenate wa-name1 wa-name2 and giving i/p  name = wa and o/p = v_name
and in text &v_name&
where v_name is defined in global defnation
i have got output
thanks
Edited by: navinm on Jan 21, 2012 5:09 AM

Similar Messages

  • How to Concatenate Table name and Where condition at runtime

    I am passing parameter as User and Zone to Stored Procedure.How to concatenate Table Name
    and WHERE CONDITION in SQL Statement.i have different type of users and zones.

    Hi !
    declare
      cur sys_refcursor;
      r emp%rowtype;
      v_sql varchar2(512);
    begin
    -- do your logic here
      v_sql := 'select * from emp';
      open cur for v_sql;
      loop
        fetch cur into r;
        exit when cur%notfound;
        dbms_output.put_line(r.ename);
      end loop;
      close cur;
    end;In this example you can see how can be done this with cursor vars .. You should concatenate v_sql string according to your requirements.
    But as in further posts has already been mentioned , be carefull at publishing such kind of procedures and think on security.
    Also when you want dynamicaly change from clause , you should consider using different records to accept data ? Maybe all your tables has the same structure and then this problem will be smaller.
    T
    T

  • How to call ALV Report and SMARTFORMS through Pushbutton

    hi,
    i have created a report.My task is to create two buttons:
    1)ALV Report.
    2)SMARTFROMS.
    Through these button i have to call ALV Report and SMARTFORMS. i have created both button and when i execute the program,
    it shows me the button but not working when i click on it.
    this is the coding i have used in my report for calling ALV Report.
    ''Tables sscrfields,
    DATA flag(1) Type c.
    selection-screen: begin of screen 500 AS WINDOW TITLE tit,
    BEGIN OF LINE,
    PUSHBUTTON 2(18) but1 USER-COMMAND cli1,
    end of line,
    BEGIN OF LINE,
    PUSHBUTTON 2(18) but2 USER-COMMAND cli2,
    end of line,
    end of screen 500.
    SET PF-STATUS 'STATUS_0100'.
    at selection-screen.
    case sscrfields.
    WHEN 'cli1'.
    flag = '1'.
    WHEN 'cli2'.
    flag = '2'.
    endcase.
    at USER-COMMAND.
    CASE SY-UCOMM.
    WHEN 'Detail'.
    select vbakkunnr VBakernam VBAkaudat vbakaufnr vbapKWMENG vbapmatnr vbap~ARKTX
    into but1
    from vbak inner join vbap
    on vbakvbeln = vbapvbeln.
    ENDSELECT.
    ENDCASE.
    START-OF-SELECTION.
    tit = 'Format'.
    but1 = 'ALV Report'.
    but2 = 'SMARTFORMS'.
    CALL SELECTION-SCREEN 500.
    and i also use in my report
    ''case sscrfields-ucomm'' and ''submit my_report'' but the still button doesn't show the result.
    Thanks & Regards,

    Hi,
             I  understood your requirement. What i found is,  you are creating screen 500 and call it after START-OF-SELECTION,
    at that time your AT USER-COMMAND doesn't work.
    So what i would suggest , u should create GUI STATUS named ' PFSTAT' 
    having one functional key 'EXIT'  that is standard u can just name it
    and
    other two u can assign in Freely assigned Function keys as 'BUT1' & 'BUT2'.  and than in Application Toolbar u jst have it in ITEM LIST by typing BUT1 and BUT2.
    For 'BUT1'  text would be 'ALV'  and 'BUT2' text would be 'SMARTFORMS'.
    Now in Program you can code,,,
    START-OF-SELECTION.
    SET PF-STATUS 'PFSTAT'.
    WRITE:/ 'TEST'.
    at user-command.
      case SY-UCOMM.
        WHEN 'BUT1'.
        WHEN 'BUT2'.
        WHEN 'EXIT'.
           LEAVE PROGRAM.
      endcase.
    In Program u set PF STATUS and use at user-command event, whcih gets triggered when u click on button . When u execute program you get two button in application tooldbar.
    Please do needful.
    Thanks,
    Saurin SHah

  • How to concatenate mkpf-belnr  and mkpf-mjahr

    hi,
    i need to concatenate mkpf-belnr  and mkpf-mjahr in select statement and i am going to check the output of concatenation in to my select statement.
    is there any way i can do this....
    thanks,
    jigar

    Refer this
    DATA: v_awkey LIEK bkpf-awkey.
    CONCATENATE mkpf-belnr mkpf-mjahr INTO v_awkey.
    SELECT * FROM BKPF
                   INTO TABLE i_bkpf
                   WHERE awkwy = v_awkey.
    In case if u want to concatenate inside a loop.
    LOOP AT i_mkpf.
    CONCATENATE i_mkpf-belnr i_mkpf-mjahr INTO i_mkpf-awkey.
    MODIFY i_mkpf.
    CLEAR i_mkpf.
    ENDLOOP.
    SELECT * FROM BKPF
                    FOR ALL ENTRIES IN i_mkpf            
                   INTO TABLE i_bkpf
                   WHERE awkey = i_mkpf-awkey.

  • How can we debugging scripts and smartforms

    hi
    experts can u help me for this

    Hi,
    There are 2 separate kinds of debugging available when you try to debug scripts.
    1. Debugging the print program : This is the normal debugging we do for our report programs.
    2. Debugging the script itself : You Can debug a SAP Script by activating debugger in two ways:
    a .In SE71->Menu->Utilities->Activate Debugger, then debugger will be get activated and when your print program is executing Script Debugger will be in active and you can proceed with your debugging.
    b. Goto se38-> RSTXDBUG ->Execute this same as going thru in se71-> Menu, now debugger will be activated.
    refer to the link below
    http://www.howforge.com/how-to-debugging-sapscript-form
    Look at the BLOG here, it is well explained
    /people/sudheer.junnuthula2/blog/2007/01/09/script-debugging
    <b>DEBUG A SMARTFORM</b>
    In the Smartform, within the Code Node you can hardcode a normal abap Break Point ..
    Please set a break point in side the smartform:
    BREAK <USERNAME>.
    Then at the time of print/ preview the program stops there.
    Example : If you set the break point in initializationas
    BREAK <USERNAME>.
    Program stops at break point. After that use Serach and set more break points.
    >Search the program logic/Textelement/Address via search and set the break point at that code.
    Other way to debug smartform is to debug the Function Module of that smartforms. If you want to debug particular smartform node that the solution would be, insert a "Program Line" just above the node you want to debug and this program line write a normal abap breakpoint. So whenever you call the smartforms, it will stop at this breakpoint and you can debug onwards.
    or
    SFTRACE can be used for debugging SMARTFORMS.
    Read More here.
    http://help.sap.com/saphelp_erp2004/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    See the Below thread for how to debug the Smartforms
    How to Debug Smartform?
    Re: debug of smartfrom
    Smart forms
    Regards,
    Priyanka.

  • HOW TO SEND THE REPORTS AND  THROUGH XI TO NON -SAP SYSTEM

    Hi Experts,
                 I want to know how to send the reports and  smartform through xi to another system. All the post blogs are   just explaning only about the FILE-TO-FILE, FILE-TO-IDOCS scenarios only.

    Hi,
    XI is the middleware that to be used to transfer the data between various systems and even you could design the Business Processes with it.
    In R/3 the smartforms, are generally converted to PDF and then  have to send it across to Non SAP systems. Similarly you can convert the smartforms to pdf format and keep it on application server. XI will pick up that pdf and will send it to Non SAP system either as mail or as an attachments.
    ABAP reports are normally used to re-present the data. If you need to transfer this data across the Non SAP systems then you have the IDOCs to be generated, RFC or ABAP Proxy to integrate this data with Non SAP system.
    XI is not restricted only upto file to file or file to IDOC scenarios. It have enormous capabilities to involve various Business Processes as well integrate various SAP or Non SAP systems.
    If need anymore  specific details, please let us know.
    Thanks
    Swarup

  • Converting the script and smartforms to OTF and RDI format.

    How to convert the script and smartforms to OTF and RDI format. Please suggest all possible ways.

    Please don't cross-post or duplicate-post.
    It increases the chances that both threads are deleted faster than what it increases the chances of getting "double-good" answers...
    I deleted the other thread.
    Thanks,
    Julius

  • How to find bar codes and mails to send clients in smartforms

    HI friends,
        How to find bar codes in smartforms and also how to send mail to the client. I have developed one object in smartforms, but i don't know how to send maill to the client. Pls help me........................
    Thanks in Advance.
    Saradhi.

    Hi!
    Here is the code to send the Smartform to mail as PDF attachment.
    *& Report ZTEST_PDF_MAIL
    REPORT ZTEST_PDF_MAIL.
    Internal Table declarations
    DATA: I_OTF TYPE ITCOO OCCURS 0 WITH HEADER LINE,
    I_TLINE TYPE TABLE OF TLINE WITH HEADER LINE,
    I_RECEIVERS TYPE TABLE OF SOMLRECI1 WITH HEADER LINE,
    I_RECORD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    Objects to send mail.
    I_OBJPACK LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
    I_OBJTXT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    I_OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    I_RECLIST LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
    Work Area declarations
    WA_OBJHEAD TYPE SOLI_TAB,
    W_CTRLOP TYPE SSFCTRLOP,
    W_COMPOP TYPE SSFCOMPOP,
    W_RETURN TYPE SSFCRESCL,
    WA_DOC_CHNG TYPE SODOCCHGI1,
    W_DATA TYPE SODOCCHGI1,
    WA_BUFFER TYPE STRING, "To convert from 132 to 255
    Variables declarations
    V_FORM_NAME TYPE RS38L_FNAM,
    V_LEN_IN LIKE SOOD-OBJLEN,
    V_LEN_OUT LIKE SOOD-OBJLEN,
    V_LEN_OUTN TYPE I,
    V_LINES_TXT TYPE I,
    V_LINES_BIN TYPE I.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    FORMNAME = 'ZTEST'
    IMPORTING
    FM_NAME = V_FORM_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.
    ENDIF.
    W_CTRLOP-GETOTF = 'X'.
    W_CTRLOP-NO_DIALOG = 'X'.
    W_COMPOP-TDNOPREV = 'X'.
    CALL FUNCTION V_FORM_NAME
    EXPORTING
    CONTROL_PARAMETERS = W_CTRLOP
    OUTPUT_OPTIONS = W_COMPOP
    USER_SETTINGS = 'X'
    IMPORTING
    JOB_OUTPUT_INFO = W_RETURN
    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.
    I_OTF[] = W_RETURN-OTFDATA[].
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    FORMAT = 'PDF'
    MAX_LINEWIDTH = 132
    IMPORTING
    BIN_FILESIZE = V_LEN_IN
    TABLES
    OTF = I_OTF
    LINES = I_TLINE
    EXCEPTIONS
    ERR_MAX_LINEWIDTH = 1
    ERR_FORMAT = 2
    ERR_CONV_NOT_POSSIBLE = 3
    OTHERS = 4.
    IF SY-SUBRC <> 0.
    ENDIF.
    LOOP AT I_TLINE.
    TRANSLATE I_TLINE USING '~'.
    CONCATENATE WA_BUFFER I_TLINE INTO WA_BUFFER.
    ENDLOOP.
    TRANSLATE WA_BUFFER USING '~'.
    DO.
    I_RECORD = WA_BUFFER.
    APPEND I_RECORD.
    SHIFT WA_BUFFER LEFT BY 255 PLACES.
    IF WA_BUFFER IS INITIAL.
    EXIT.
    ENDIF.
    ENDDO.
    Attachment
    REFRESH: I_RECLIST,
    I_OBJTXT,
    I_OBJBIN,
    I_OBJPACK.
    CLEAR WA_OBJHEAD.
    I_OBJBIN[] = I_RECORD[].
    Create Message Body Title and Description
    I_OBJTXT = 'test with pdf-Attachment!'.
    APPEND I_OBJTXT.
    DESCRIBE TABLE I_OBJTXT LINES V_LINES_TXT.
    READ TABLE I_OBJTXT INDEX V_LINES_TXT.
    WA_DOC_CHNG-OBJ_NAME = 'smartform'.
    WA_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
    WA_DOC_CHNG-OBJ_DESCR = 'smartform'.
    WA_DOC_CHNG-SENSITIVTY = 'F'.
    WA_DOC_CHNG-DOC_SIZE = V_LINES_TXT * 255.
    Main Text
    CLEAR I_OBJPACK-TRANSF_BIN.
    I_OBJPACK-HEAD_START = 1.
    I_OBJPACK-HEAD_NUM = 0.
    I_OBJPACK-BODY_START = 1.
    I_OBJPACK-BODY_NUM = V_LINES_TXT.
    I_OBJPACK-DOC_TYPE = 'RAW'.
    APPEND I_OBJPACK.
    Attachment (pdf-Attachment)
    I_OBJPACK-TRANSF_BIN = 'X'.
    I_OBJPACK-HEAD_START = 1.
    I_OBJPACK-HEAD_NUM = 0.
    I_OBJPACK-BODY_START = 1.
    DESCRIBE TABLE I_OBJBIN LINES V_LINES_BIN.
    READ TABLE I_OBJBIN INDEX V_LINES_BIN.
    I_OBJPACK-DOC_SIZE = V_LINES_BIN * 255 .
    I_OBJPACK-BODY_NUM = V_LINES_BIN.
    I_OBJPACK-DOC_TYPE = 'PDF'.
    I_OBJPACK-OBJ_NAME = 'smart'.
    I_OBJPACK-OBJ_DESCR = 'test'.
    APPEND I_OBJPACK.
    CLEAR I_RECLIST.
    I_RECLIST-RECEIVER = '[email protected]'.
    I_RECLIST-REC_TYPE = 'U'.
    APPEND I_RECLIST.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    DOCUMENT_DATA = WA_DOC_CHNG
    PUT_IN_OUTBOX = 'X'
    COMMIT_WORK = 'X'
    TABLES
    PACKING_LIST = I_OBJPACK
    OBJECT_HEADER = WA_OBJHEAD
    CONTENTS_BIN = I_OBJBIN
    CONTENTS_TXT = I_OBJTXT
    RECEIVERS = I_RECLIST
    EXCEPTIONS
    TOO_MANY_RECEIVERS = 1
    DOCUMENT_NOT_SENT = 2
    DOCUMENT_TYPE_NOT_EXIST = 3
    OPERATION_NO_AUTHORIZATION = 4
    PARAMETER_ERROR = 5
    X_ERROR = 6
    ENQUEUE_ERROR = 7
    OTHERS = 8.
    IF SY-SUBRC <> 0.
    WRITE:/ 'Error When Sending the File', SY-SUBRC.
    ELSE.
    WRITE:/ 'Mail sent'.
    ENDIF.
    If you want to send some text as Body of the Mail then follow this once
    when u r callin the FM'SO_NEW_DOCUMENT_ATT_SEND_API1'.. points to remember
    1.u have to pass the body of content in table CONTENTS_TXT(ia m using I_OBJBIN) (each line a record) then. suppose i have appended 11 records to the table CONTENTS_TXT .
    2.PACKING_LIST(iam usign I_OBJPACK) table u ahve to append a redord as follows
    I_OBJPACK-TRANSF_BIN = ' '.
    I_OBJPACK-HEAD_START = 000000000000001.
    I_OBJPACK-HEAD_NUM = 000000000000001.
    I_OBJPACK-BODY_START = 000000000000002
    I_OBJPACK-BODY_NUM = 000000000000010.
    I_OBJPACK-DOC_TYPE = 'RAW'.
    append I_OBJPACK-.
    by the above code system treat the first line in table I_OBJBIN as header and the 2nd line to 10 lines tread as body.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    DOCUMENT_DATA = WA_DOC_CHNG
    PUT_IN_OUTBOX = 'X'
    TABLES
    PACKING_LIST = I_OBJPACK
    OBJECT_HEADER = WA_OBJHEAD
    CONTENTS_BIN = I_OBJBIN
    CONTENTS_TXT = I_OBJTXT
    RECEIVERS = I_RECLIST
    EXCEPTIONS
    TOO_MANY_RECEIVERS = 1
    DOCUMENT_NOT_SENT = 2
    DOCUMENT_TYPE_NOT_EXIST = 3
    OPERATION_NO_AUTHORIZATION = 4
    PARAMETER_ERROR = 5
    X_ERROR = 6
    ENQUEUE_ERROR = 7
    OTHERS = 8.
    Regards
    Tamá

  • How to put Check Boxes and Radio button in Smartforms

    Hi all,
    How to put check Box and radio button in Smartforms ............ from web properties there is an option to use. But How to use.     
    regards,
    Mohsin

    u can declare the checkboxes or radiobuttons whatever in driver program and pass the same to ur form...

  • How to Debug the Driver Pgm and Smartform while Invoice Creation(VF01)

    Hello All,
    I've configured the Driver Pgm and Smart Form in NACE for the output type RD00. I would like to debug the Driver Pgm and Smartform while creation of invoice using VF01. I've set the break points in the Driver Pgm and Smart form, but its not taking me to there while creating an Invoice using VF01.
    Once the Invoice created, If I go thru the VF02/VF03 to see the output, I'm able to debug.
    Please help me to debug the Driver Program and Smartform during the Invoice Creation.
    I've configured the following objects in NACE:
    Program ZDRIVER_PGM_INVOICE_SMARTFORM
    Form Routine ENTRY
    PDF/Smartform Form ZINVOICE(Smartform)
    Thanks in Advance!
    Anil S.

    Moderator message - Welcome to SCN.
    But please read Please read "The Forum Rules of Engagement" before posting!  HOT NEWS!! and How to post code in SCN, and some things NOT to do... before posting. In particular, asking the same question multiple times is not allowed.
    Thread locked
    Rob

  • How to transport scripts and smartforms layouts

    Hi All,
              would you let me know how to trasport scripts and smartform along with layouts???
    thanks in advance for your replies.
    Regards,
    Riyaz

    SAP Script Form
    If you want to copy the forms between clients on the same system (between a client 100 and 150 on a DEV box for example) Use the copy between clients option available from the Utilities menu of SE71. If you want to transport the form between DEV & QA or QA & PRD then follow the normal transport
    procedure (ensuring that your BASIS team know to import your form into each client of the new box).
    Regarding the Print Program, follow the standard procedure for normal ABAP Objects. Do SCC1 for transfer between clients on same system and normal transport procedure to different system.
    SMART FORMS
    A Smartform is transported no differently than any other object. if it is assigned to a development class that is atteched to a transport layer, it will be transported. 
    The definition is transported, and when called, the function module is regenerated. 
    This leads to an interetsing situation. On the new machine, it is very likely the function module name will be different than the name on the source system. Make sure, before you call the function module, you resolve the external name to the internal name using the 'SSF_FUNCTION_MODULE_NAME' function module. 
    Typically, generate the SF, then use the pattern to being in the interface. Then change the call function to use the name you get back from the above function module. 
    Hope this helps.
    Vinodh Balakrishnan

  • How to set the Mail and Fax options  for the Smartforms ???

    How to set the Mail and Fax options  for the Smartforms ??? Please reply me very soon. Its a life deciding question now for me. Please .

    >
    veera Karthik wrote:
    > How to set the Mail and Fax options  for the Smartforms ??? Please reply me very soon. Its a life deciding question now for me. Please .
    Hi
    Check this Link:
    http://help.sap.com/saphelp_nw04/helpdata/en/a5/28d3b9d26211d4b646006094192fe3/frameset.htm
    P.S: Never say reply me soon....people answer you here voluntarily and as everyone has their own desk to manage...sp replies may late or early..depending upon the availabality of the members.
    Vishwa.

  • How to find out existing Reports and sap scripts and smartforms ?

    Dear Friends ,
    How to find out existing Reports and sap scripts and smartforms ?
    ( e.g: how many existing reports and SAP scripts are available in MM or SD module , What is the procedure to find out ? )
    Thanking you.
    Regards,
    Subash.

    scripts r stored in TNAPR TABLES

  • How to write driver programming in smartforms

    hi Floks
    <i>how to write driver programmig and how many types of driver programs available to trigger smartforms what are they . how to call the url in smartforms ?
    help me  out  .thanking you ,</i>
    with regards,
    suresh

    Hi
    Try to get the Function module name from the smart form
    how to find Driver program for a smartform
    and now goto SE38 and create a progarm for calling the smartform
    smartform driver program
    Regards
    Kathirve

  • How to pull the data into smartform after designing layout?

    how to pull the data into smartform after designing layout?

    call the smartform in your Driver program and pass your output internal tables in the smartforms paramaters
    Check the below Sample code.
    FORM label_print.
      DATA : g_fm_name TYPE rs38l_fnam,
             g_output  TYPE ssfcompop,
             g_control TYPE ssfctrlop,
             g_form TYPE tdsfname VALUE 'ZPRINT_LABELS',
             g_dest TYPE rspopname,
             g_printer TYPE rspoptype..
      REFRESH : i_out[],i_qals[].
      SELECT matnr maktx
             INTO TABLE i_out
             FROM makt
             FOR ALL ENTRIES IN i_mseg
             WHERE matnr = i_mseg-matnr
             AND   spras = sy-langu.
      SELECT prueflos objnr ersteldat erstelzeit matnr revlv charg mengeneinh
             INTO TABLE i_qals
             FROM qals
             FOR ALL ENTRIES IN i_mseg
             WHERE matnr = i_mseg-matnr
             AND   charg = i_mseg-charg.
    *FM to accept the device type and returns the short name of the output device
      CALL FUNCTION 'EFG_GET_PRINTER'
        EXPORTING
          x_no_dialog  = ' '
          x_obligatory = 'X'
        IMPORTING
          y_tddest     = g_dest
        EXCEPTIONS
          cancelled    = 1
          failed       = 2
          OTHERS       = 3.
    *device type name for the output device
      SELECT SINGLE patype                                  "#EC CI_NOFIELD
             FROM tsp03d
             INTO g_printer
             WHERE padest = g_dest.
    *printer setting
      g_control-no_dialog = 'X'.
      g_output-tdarmod = '1'.
      g_output-tdcopies = '001'.
      g_output-tddest = g_dest.
      g_output-tdprinter = g_printer.
      g_output-tdnewid = 'X'.
      g_output-tdimmed = 'X'.
      CLEAR wa_mseg.
      LOOP AT i_mseg INTO wa_mseg.
        READ TABLE i_out INTO wa_out WITH KEY matnr = wa_mseg-matnr.
    check for the status and filter the records
        CLEAR : wa_qals.
        LOOP AT i_qals INTO wa_qals WHERE matnr = wa_mseg-matnr
                                    AND charg = wa_mseg-charg.
          CALL FUNCTION 'STATUS_TEXT_EDIT'
            EXPORTING
              objnr            = wa_qals-objnr
              spras            = sy-langu
            IMPORTING
              line             = l_status
            EXCEPTIONS
              object_not_found = 1
              OTHERS           = 2.
          IF l_status CS 'LTCA' OR l_status CS 'SKIP'.
            DELETE i_qals.
          ENDIF.
        ENDLOOP.
        SORT i_qals BY ersteldat DESCENDING erstelzeit DESCENDING.
        IF i_qals IS INITIAL.
          l_msg = text-002.
        ELSE.
          READ TABLE i_qals INTO wa_qals INDEX 1.
          SELECT prueflos vbewertung
                 INTO TABLE i_qave
                 FROM qave
                 WHERE prueflos = wa_qals-prueflos
                 AND   kzart = 'L'.
          IF sy-subrc <> 0.
            l_msg1 = text-003.
          ENDIF.
          SORT i_qave.
          CLEAR : wa_qave.
          IF NOT i_qave IS INITIAL.
            READ TABLE i_qave INTO wa_qave INDEX 1.
            IF wa_qave-vbewertung = 'A'.
              l_msg = text-002.
            ELSEIF wa_qave-vbewertung = 'R'.
              l_msg1 = text-003.
            ELSE.
              l_msg1 = text-003.
            ENDIF.
          ENDIF.
        ENDIF.
        CLEAR : wa_ser03.
        READ TABLE i_ser03 INTO wa_ser03 WITH KEY mblnr = wa_mseg-mblnr.
    *Calling Smartform
        CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
          EXPORTING
            formname           = g_form
          IMPORTING
            fm_name            = g_fm_name
          EXCEPTIONS
            no_form            = 1
            no_function_module = 2
            OTHERS             = 3.
        LOOP AT i_objk INTO wa_objk WHERE obknr = wa_ser03-obknr.
    *Calling FM generated from the smartform
          DATA : l_date(10) TYPE c,
                 l_date1(10) TYPE c,
                 l_date2(10) TYPE c,
                 l_date3(10) TYPE c,
                 l_hyphen(1) TYPE c VALUE '-'.
          CLEAR : l_date,l_date1,l_date2,l_date3.
          l_date1 = wa_mseg-vfdat+0(4).
          l_date2 = wa_mseg-vfdat+4(2).
          l_date3 = wa_mseg-vfdat+6(2).
          CONCATENATE l_date1 l_hyphen l_date2 l_hyphen l_date3 INTO l_date.
          CALL FUNCTION g_fm_name
            EXPORTING
              control_parameters = g_control
              output_options     = g_output
              user_settings      = ' '
              g_matnr            = wa_mseg-matnr
              g_mat_text         = wa_out-maktx
              g_batch            = wa_mseg-charg
              g_rev              = wa_qals-revlv
              g_edate            = l_date
              g_lot              = wa_qals-prueflos
              g_qty              = wa_mseg-erfmg
              g_uom              = wa_mseg-erfme
              g_serial           = wa_objk-sernr
              g_smsg             = l_msg
              g_fmsg             = l_msg1
            EXCEPTIONS
              formatting_error   = 1
              internal_error     = 2
              send_error         = 3
              user_canceled      = 4
              OTHERS             = 5.
          CLEAR  g_output-tdnewid.
        ENDLOOP.
        IF sy-subrc <> 0.
          CLEAR : l_date,l_date1,l_date2,l_date3.
          l_date1 = wa_mseg-vfdat+0(4).
          l_date2 = wa_mseg-vfdat+4(2).
          l_date3 = wa_mseg-vfdat+6(2).
          CONCATENATE l_date1 l_hyphen l_date2 l_hyphen l_date3 INTO l_date.
          CALL FUNCTION g_fm_name
            EXPORTING
              control_parameters = g_control
              output_options     = g_output
              user_settings      = ' '
              g_matnr            = wa_mseg-matnr
              g_mat_text         = wa_out-maktx
              g_batch            = wa_mseg-charg
              g_rev              = wa_qals-revlv
              g_edate            = l_date
              g_lot              = wa_qals-prueflos
              g_qty              = wa_mseg-erfmg
              g_uom              = wa_mseg-erfme
              g_serial           = wa_objk-sernr
              g_smsg             = l_msg
              g_fmsg             = l_msg1
            EXCEPTIONS
              formatting_error   = 1
              internal_error     = 2
              send_error         = 3
              user_canceled      = 4
              OTHERS             = 5.
          CLEAR g_output-tdnewid.
        ENDIF.
      ENDLOOP.
      IF sy-subrc = 0.
        MESSAGE i000(zm).
      ENDIF.
    ENDFORM.                    " label_print

Maybe you are looking for

  • A Problem about zip a Chinese File with Java Zip package

    Hi, my problem is following: I use "Java(1.3.1_02) Zip package" to compress some files into a zip File all thing is smooth except one:( If there is a fileName with Chinese (big5 encoding) characters it doesen't work! Can anyone tell me how to do? Tha

  • Help with Frequency/voltage Ctrl settings in CMOS

    I have the K7N420 Pro Mobo and the Ge4Ti4200 card. I just ran 3DMark01, after a new bare hard drive, fresh install of Win XP and running Live Update on my drivers. I got a low score of 7459. On my old hard drive yesterday I got a score of 9745. I als

  • No Two Way Sync For Notes?

    3Gs, latest iTunes and I got a sync message as to a conflict between Mail and the iPhone. One note did indeed have different text than the other but I wanted to keep both...no option and the tool doesn't merge the records. Is this normal? Do the note

  • Forms 6i and Xterm

    Hi, I have Oracle 8+ database on HP-UX and using Forms 6i to generate User Interfaces. I am using Exceed on Win 95 (for Xterm) to generate develop the forms and generate the .fmx on Unix box. But, when users connect to Unix and with Exceed and xterm

  • CS6 File Sizes

    Hi In general, I save my documents as uncompressed TIF files. On a recent project I have noticed that the files being created appear particularly large and are significantly bigger than the size indicated in the status bar. An example: Document is 16