Printing ranges for smartforms

dear all,
i have a task which requires me to find the ranges in a set of numbers..
sample data: R09004016, R020185M01, R050015M<M04, R09004018, R020185M03, R050015M<M05,
R09004017, R020185M02, R050015M<M06, R020185M12, R09004002
these are the norsec numbers... which are needed to group them together if these numbers have the same characteristics..
the expected output would be
R09004002, R09004016 TO R09004018, R020185M01 TO R020185M03, R020185M12,
R050015M<M04 TO R050015M<M06 
my question is, how do i put these norsec numbers into ranges...? and the problem is that some norsec numbers have characters inside...the norsec numbers are alphanumeric..
any help is very much appreciated..thanks..
urgent.

Hi
   Please check if below code can help to lead you.
data: begin of itab occurs 0,
        fld1(20) type c,
      end of itab.
data: begin of it_out occurs 0,
        text(50) type c,
      end of it_out.
itab-fld1 = 'R09004016'.
append itab.
itab-fld1 = 'R020185M01'.
append itab.
itab-fld1 = 'R050015M<M04'.
append itab.
itab-fld1 = 'R09004018'.
append itab.
itab-fld1 = 'R020185M03'.
append itab.
itab-fld1 = 'R050015M<M05'.
append itab.
itab-fld1 = 'R09004017'.
append itab.
itab-fld1 = 'R020185M02'.
append itab.
itab-fld1 = 'R050015M<M06'.
append itab.
itab-fld1 = 'R020185M12'.
append itab.
itab-fld1 = 'R09004002'.
append itab.
data: from(20) type n,
      to(20) type n.
data: from_c like itab-fld1, "type c,
      to_c like itab-fld1. "type c.
sort itab by fld1.
loop at itab.
     if sy-tabix eq 1.
        from = itab-fld1.
        from_c = itab-fld1.
     else.
        perform compare using itab-fld1 to changing from.
     endif.
     to = itab-fld1.
     to_c = itab-fld1.
     at last.
        perform compare using to to changing from.
     endat.
endloop.
loop at it_out.
    write:/ it_out-text.
endloop.
form compare using p_fld1 p_to changing p_from.
data: l_to(20) type n.
data: l_fld(20) type n.
    l_to = p_to + 1.
    l_fld = p_fld1.
    if l_fld ne l_to.
       if p_to > p_from.
          concatenate from_c 'TO' to_c into it_out-text
                      separated by space.
          append it_out.
       else.
          move from_c to it_out-text.
          append it_out.
       endif.
       p_from = itab-fld1.
       from_c = itab-fld1.
     endif.
endform.
Kind Regards
Eswar

Similar Messages

  • How to write print program for smartforms

    Hi all
    I need to develop new smartform and its print program.
    But Im not experience in writing print program for smartform.
    Ive gone through the simple print program sample that use only one table as input and one table for output.
    But my smartforms require few tables for input and output.
    How should I define the Data?
    Can anyone guide me on how to write it.
    Thanks & Regards
    az

    Transaction code SMARTFORMS
    Create new smartforms call ZSMART
    2. Define looping process for internal table
    Pages and windows
    First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
    Here, you can specify your title and page numbering
    &SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
    Main windows -> TABLE -> DATA
    In the Loop section, tick Internal table and fill in
    ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
    3. Define table in smartforms
    Global settings :
    Form interface
    Variable name Type assignment Reference type
    ITAB1 TYPE Table Structure
    Global definitions
    Variable name Type assignment Reference type
    ITAB2 TYPE Table Structure
    4. To display the data in the form
    Make used of the Table Painter and declare the Line Type in Tabstrips Table
    e.g. HD_GEN for printing header details,
    IT_GEN for printing data details.
    You have to specify the Line Type in your Text elements in the Tabstrips Output options.
    Tick the New Line and specify the Line Type for outputting the data.
    Declare your output fields in Text elements
    Tabstrips - Output Options
    For different fonts use this Style : IDWTCERTSTYLE
    For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
    5. Calling SMARTFORMS from your ABAP program
    REPORT ZSMARTFORM.
    Calling SMARTFORMS from your ABAP program.
    Collecting all the table data in your program, and pass once to SMARTFORMS
    SMARTFORMS
    Declare your table type in :-
    Global Settings -> Form Interface
    Global Definintions -> Global Data
    Main Window -> Table -> DATA
    Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
    http://sapr3.tripod.com
    TABLES: MKPF.
    DATA: FM_NAME TYPE RS38L_FNAM.
    DATA: BEGIN OF INT_MKPF OCCURS 0.
    INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF.
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
    MOVE-CORRESPONDING MKPF TO INT_MKPF.
    APPEND INT_MKPF.
    ENDSELECT.
    At the end of your program.
    Passing data to SMARTFORMS
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'ZSMARTFORM'
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    FM_NAME = FM_NAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    if sy-subrc 0.
    WRITE: / 'ERROR 1'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function FM_NAME
    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 =
    TABLES
    GS_MKPF = INT_MKPF
    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.
    Reward points...

  • To find print program for smartforms.

    pls tell me how to find print programs for smartforms.pls tell me with all steps.clearly.i tried with tanpr table but unable to find

    hi,
    Please take a look at the NACE transaction where all the output conditions will be configured. Drill down into you specific application and you should be able to find the print program as well as the smart form name.
    Steps..
    Use NACE and follow procedure as follows
    1)Choose Application from list(eg PO)
    2)Click OP type
    3)Chose one OP type from Right pane.
    4)Click on processing routines
    and you got it
    regards,
    keerthi

  • Need Print Program for Smartform /SAPSLL/SF_GL_EPL for Export Packing list

    Hello Friends,
                         I need a print program for Smartform /SAPSLL/SF_GL_EPL for Export Packing list. Please reply ASAP.
    Thanks,
    Ziad.

    Hi Sowjanya,
                         I am using FUEP o/p type for Export Packing list for Billing . I Copied SAPscript SD_EXPORT_FUEP form and the  print program for this is same RVADAUS1. Can we use the same print program for Smartform  /SAPSLL/SF_GL_EPL?
    Thanks,
    Ziad

  • Using standard PO Printing Program for Smartforms

    Hi Experts,
    I am some hiccups coding my print program for a PO Smartform that am currently working on.The requirement was to use the standard print program to trigger my Smartform PO. I have read alot of threads on this, but am still clueless.
    Some says to comment out the functions like "OPEN_FORM" ,"WRITE_FORM" and having your block of codes inside the "NEU_" routine.
    But I noticed, there are even some conditions and logic checking before the "write_form" is called and sometimes the table entries are also cleared. In this kind of situation, how should I be passing the table data to the Smartform function module?By copying the contents to an internal table? And there are many include programs which currently the standard program has, should I be using all that too?
    Appreciate your input and advice on this.
    Thanks very much.

    Hi Neesha,
    Can you check this once
    [Migrating Forms|http://help.sap.com/saphelp_nw04/helpdata/en/9d/9599386185c064e10000009b38f8cf/content.htm]
    Regards,
    Madhu.
    Edited by: madhurao123 on Dec 21, 2011 9:18 AM

  • Adding bar codes to printer device for smartforms pdf conversion?

    Hello friends,
    I would like to send a smartform as a pdf to an email recipient. The smartform shows some bar codes. The send process workes fine. But the bar codes doesn't appear on the pdf correctly. Therefore I would like to add bar codes to the printer device type in transaction SE73.
    Does somebody know the device type for smartforms pdf conversion? Or how can I add bar codes to smartforms pdf conversion process?
    greetings
    daniel

    Hello Denial,
    Try these links, this might solve ur problem
    http://www.tec-it.com//documentation/TBarCodeSAPLPD_EN.htm
    http://www.mecsw.com/info/appnote/app_024.html
    if you need any more information send me at [email protected]
    Thanks & Best Regards
    Ankur Jain

  • Generating print program for smartform

    Hiii   friends can u plz help me in getting the solution.Here I m giving the details about the requirement.
    1) we have to create a report which consists of alv grid.
    2) Next we have create a smart form & generate print prog for it.
    3) In reports we are placing 2 push buttons i.e (1) print (2) print preview. If we press print button then it should call the form.
    plz help in doing this thank you.
    Moderator message : Spec/requirements dumping is not allowed, show the work you have already done. Thread locked.
    Edited by: Vinod Kumar on Oct 18, 2011 10:44 AM

    CONTROL-preview = ' '.
    CONTROL-no_open = 'X'.
    CONTROL-no_close = 'X'.
    CONTROL-no_dialog = 'X'.
    CONTROL-device = 'PRINTER'.
    OUTPUT_OPTIONS-TDDEST = tdest.
    OUTPUT_OPTIONS-TDNOPRINT = 'X'.
    OUTPUT_OPTIONS-tdimmed = 'X'.
    OUTPUT_OPTIONS-tdnewid = 'X'.   use this filed
    OUTPUT_OPTIONS-tddataset = 'XYZ'.
    CALL FUNCTION 'SSF_OPEN'
    EXPORTING
    output_options = output_options
    control_parameters = CONTROL
    user_settings = ' '
    EXCEPTIONS
    formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 4
    OTHERS = 5.

  • Print issue for smartform by zebra QL420plus in SAP

    Hi All,
    I created a smartform in SAP to print out label on zebra QL420Plus.
    Current the key issue is that I can not print out smart form from SAP to QL420plus directly. I need to print some text from windows by notepad or word after I power on QL420plus. Then QL420plus seem to be active. So at this point I can print out smartfrom from SAP to QL420plus. I am not sure what’s wrong with QL420plus equipment?
    Thanks.
    Crystal

    did you try like this :
    Spool
    data: in_list     like  pri_params-plist,
          in_dataset  like  pri_params-prdsn,
          in_spool(1) type  c,
         d_dest          like pri_params-pdest.
    NEW-PAGE PRINT ON
                NO-HEADING
                NO-TITLE
                LIST NAME in_list
                LIST DATASET in_dataset
                LINE-SIZE 132
                LINE-COUNT 65
                COPIES 1
                NO DIALOG
                KEEP IN SPOOL ''
                DESTINATION d_dest
                NEW LIST IDENTIFICATION in_spool
                ARCHIVE MODE '1'
                IMMEDIATELY ''.

  • How find out print program for smartform?

    i know smart form name but i want printprogram name for that.how to find?pls help me.

    Hi
    There's no method.
    If you're speaking about a smartforms for logistics module (SD,MM), you can you the transaction NACE (or table TNAPR) in order to findout which program is assigned to that smartforms.
    U can also try to find out all programs using the fm SSF_FUNCTION_MODULE_NAME and get only the program where the string containing the name of your smartform.
    Max

  • Printing Issue for Smartform

    Hi All..
    The smartform has been created and activated without any Errors.
    All the data are appearing in the Print Preview in a desired format.
    But when i take the Print, the icon is not getting printed.
    Instead of icone being printed, few dark lines are getting printed on the paper.
    Except icon, all the Text, Tables, etc are getting printed in a right manner.
    What may be the reason..???
    Please Help me out....

    Hi Pavan,
    Please check your printer settings.
    Regards,
    Chetan.

  • How to find z or standard print program for smartform

    Hi all,
    I know the smartform name from this I want find print program used whether it is z or standard program.
    Thanks in advance,
    Regards,
    Harshada

    Hi,
    1. If you know the output type then you can check the Print program name in configuration.
    You can use tcode 'NACE' and select the your functional area then click on outout types.
    Choose your output type and click on 'Processing routines'.
    It will show you the print program attached to your smartform.
    2. You can directly go to table TNAPR, give your smartform name and execute. It will give you print program attached to that smartform.
    Thanks,
    Archana

  • Print preview of smartform in word format (editable)

    Hi Everybody,
    I have a smartform. I want, when i click on the print priview , it should display in Ms word format and that to editable.
    Plz help.
    Thanks,
    Mohammadi.

    hi,
    1.convert smartform output to a word document using the function module "'RSPO_DOWNLOAD_SPOOLJOB'.
    2.Check the print options for smartform.
    3.Refer This:Re: print priview in smartforms
    Regards,
    Shiva Kumar

  • How to find Printprogram for Smartform.

    Hi,
        I want to see the print program(Executable program) of the Smartform. We have one Smartform, when we activate smartform it will generate one FM. that function module is called Dynamically. How can i know which program is calling that function module.
    Regards,
    Nagesh.

    Hi
    You can't do it.
    If your print is std, you can try the link in TNAPR table if you know the message type.
    If your print is custom, you should know the program.
    The print program for smartform has usually a code like this to run SM:
    DATA: formname  type  tdsfname value 'ZMY_SMARTFORM',
          fm_name   type  rs38l_fnam.
    Here get out the mane of fm of sf
          call function 'SSF_FUNCTION_MODULE_NAME'
            exporting
              formname           = formname
            importing
              fm_name            = fm_name
            exceptions
              no_form            = 1
              no_function_module = 2
              others             = 3.
          if sy-subrc <> 0.
            exit.
          endif.
    Here run the sf
    call function fm_name
    Max
    Message was edited by: max bianchi

  • How to avoid the repeated Print window, for range printing in a smartform

    Hi
    I developed one smartform for the single/multiple Outbond deleviry.  When I execute the query with same range then print window opened and after click print button Document priented. But when I try to execute the query with range suppose 0001 to 0003 then Print window opened and click the print the 0001 doc and again click print button for 0002 and so on.
    I would like to , how we take a print on single click print button.
    pls help me it's urget.
    Thanks in advance
    Tapovardhan

    Thanks Ravi
    But after adding code this error comes.
    Field "PRINT_PARAMS-NO_DIALOG" is unknown. It is neither in one of the
    specified tables nor defined by a "DATA" statement. "DATA" statement.
    For define the PRINT_PARAMS what would be the type.
    Our code is given below.
    REPORT  ZTESTPCLDI.
    tables :  likp.
    select-options : s_vbeln for likp-vbeln.
    data : itab_likp type standard table of likp with header line.
    DATA : FORM_NAME TYPE RS38L_FNAM.
    data : print_params type SSFCTRLOP.
    start-of-selection.
    select  * from likp into table itab_likp
    where vbeln in s_vbeln.
    end-of-selection.
    loop at itab_likp.
    if sy-tabix <> 1.
    print_params-no_dialog = space.
    else.
    print_params-no_dialog = 'X'.
    endif.
    CALL FUNCTION '/1BCDWB/SF00000045'
    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         =
      TABLES
        wa_likp                    = itab_likp
    EXCEPTIONS
       FORMATTING_ERROR           = 1
       INTERNAL_ERROR             = 2
       SEND_ERROR                 = 3
       USER_CANCELED              = 4
       OTHERS                     = 5.
       NEw-PAGE.
       endloop.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    regards,

  • Standard print program for fi invoice smartform printing

    Hi friend,
    Is there any standard print program available for printing FI related invoice .
    I want print program for printing smartforms.
    I want to know any method for searching the standard print program for printing smartform in Fi module.
    Thanks & Regards,
    Sathish

    Hi,
    FI related Forms will be configure in SPRO.
    Goto SPRO and FI related applivcation.
    There you will find the related forms and programs.

Maybe you are looking for

  • Contract as a Source

    Hi Friends I have nearly 8000 items, most of them having contract but no sourcelist. While MRP run i want to assign contract as a source to the P.R, insteaded of creating Sourcelist for all the materails. Pl guide me how can i assign contract as a so

  • Leave approval notification in microsoft outlook

    Hi All, I searched on SDN for the similar activity ,but could not get step by step procedure for this task, I have done the SMTP setting  via SCOT and selected internet in supported address types section. I tried to run  report RSWUWFML2  but no outp

  • Is it possible to turn off those annoying balloons?

    The pop up balloons are always in the way of what I'm trying to read. Can they be turned off?

  • What is the best way to share HD movies?

    I am thinking of moving from digital8 recording to HD (leaning toward HDD or SD instead of miniDV as the later seems to be getting obsolete). Now I can burn a DVD to give to low-tech family members. It does not sound like I will be able to burn HD DV

  • Help with a design

    Hello, I am attempting to replicate a design of a popular Bill Murray T-shirt and need help. On the left is the design that I want to have and on the right is my design They are close but the one on the right is too cartoonish, the edges are not as c