How to insert  blank spaces at end of a record

Hi All,
i need to write 10 records each of 80 char size. of these 10 records, each record might have different data and the last field will be a filler field which only has space.
for example:
DATA : BEGIN OF gs_mrecord        ,
         id(1)         VALUE'M'     ,
         accno(12)                  ,
         refid(2)      VALUE 'RR'   ,
         sec_cd(4)     VALUE '2437' ,
         sub_typ(1)    VALUE '6'    ,
         sub_dt(5)                  ,
         sub_seq_no(1)              ,
         sec_cd1(4)    VALUE '2437' ,
         sub_dt1(6)                 ,
         record_no(6)  TYPE n       ,
         ext_ind(1)                 ,
         plat_id(1)                 ,
         filler_1(1)               ,
         clear_code(3)              ,
         ex_merc_no(16)             ,
         filler_4(4)               , fill blank spaces
         mech_bin_no(6)             ,
         filler(6)             ,  " fill blank spaces
         END OF gs_mrecord .
like this there are 10 types with 80 char size, however the last field is a filler, in which we need to fill only blank spaces.
when i wrtie this data to the application server file i can't see the spaces and when download(to .TXT file) also i can't see the spaces.
is there anyway that i can keep the spaces at the end of the record.
Please note, in the middle of the record, we can keep the spaces as there is some data after that.
Any hint would be of great help.
Cheers,
SR.

Hi Srinivas
Just a thought, try as below:
Declare a text variable of length 80 characters. Before transferring the record to Output file, move the work area to the text field and add a New Line character at 80th position. Now tranfer this text field to file with length specification.
Eg:
DATA: l_cr(1) TYPE c VALUE cl_abap_char_utilities=>cr_lf,
      l_text(80) TYPE c.
OPEN DATASET ....
IF sy-subrc EQ 0.
   LOOP AT <itab> INTO <wa>.
      MOVE <wa> TO l_text.
      l_text+80 = l_cr.
      TRANSFER l_text TO <dsn>.
   ENDLOOP.
ENDIF.
Hope that helps, also check the codepage in which you download the file from Application server before Viewing. Maybe checking the file contents via AL11.
Hope it helps.
Regards
Eswar

Similar Messages

  • How to generate blank spaces at end of the record in a flat file with fixed

    Hi,
    I am generating a flat file with fixed length.
    In my ABAP program, i am able to see the spaces at the end of the recors in debug but when download to applicaiton server i am not able to see those spaces.
    How can i generate blank spaces at the end of the record in a flat file?
    Please update
    Thank you

    How are you downloading the file?  And, How are you looking at the file on the application server?
    Can you provide snippets of your code?
    Cheers
    John

  • How to insert blank spaces in XML tag?

    Hi Experts,
    I have a variable of type char and lenght 10 with value "ABCDE".  When I write this value in xml tag <TEXT> using simple transformation it ignores the trailing blank spaces and the result xml string looks as <TEXT>ABCDE</TEXT>.
    I want the xml tag with trailing blank spaces i.e. it should be like <TEXT>ABCDE     </TEXT>. And suppose if the variable does not contain any value, the xml tag should contain 10 blank spaces like <TEXT>          </TEXT>.
    I have tried using the solution given in this link
    http://help.sap.com/saphelp_nwpi71/helpdata/en/44/f52846257a0485e10000000a155369/frameset.htm
    but unfortunately it doesn't work.
    Please guide me to achieve this.
    Regards,
    Ravi

    ABAP prog:
    DATA: text(10)    TYPE c VALUE 'ABCDE',
          xml_xstring TYPE string.
    CALL TRANSFORMATION z_test SOURCE root = text
                            RESULT XML xml_xstring.
    WRITE xml_xstring.
    Transformation:
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
    <tt:root name="ROOT"/>
    <tt:template>
          <Text tt:value-ref="ROOT"/>
    </tt:template>
    </tt:transform>
    Result in xml string:
    <?xml version="1.0" encoding="utf-16"?>#<Text>ABCDE</Text>
    Also tried transformation using:
    <tt:template>
          <Text>
               <tt:value length="10" ref="ROOT"/>
          </Text>
    </tt:template>
    Thanks.

  • How to insert a space-bar in the Muse CC master slide page property metadata

    I'm using the latest version of Muse CC and need to know how to insert a space-bar in the master slide page property metadata page title suffix area

    I found it.  If anyone else has this problem press the shift and \ at the same time on a standard windows keyboard.

  • How to insert blank lines in the ALV output.

    Hi Friends,
    Could any body help me out How to insert blank lines in the ALV output.?? Any Code pls...
    Thank you,
    Vikram.C

    hi vikram
    do like this
    In the fieldcatalog table all the fields should be in editable mode
    ie lw_fcat-edit = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = sy-repid
    i_callback_pf_status_set = 'SET_PF_STATUS'
    i_callback_user_command = 'USER_COMMAND'
    is_layout = lv_layout
    it_fieldcat = lt_fcat[]
    i_save = 'A'
    is_variant = lv_variant
    TABLES
    t_outtab = lt_license[]
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDFORM. " display_data
    *& Form user_command
    FORM user_command USING r_ucomm TYPE sy-ucomm
    rs_selfield TYPE slis_selfield.
    CASE r_ucomm.
    WHEN 'ADD'. "
    data: lv_ind type i.
    data: lv_line type i.
    describe table lt_license lines lv_line.
    loop at lt_license into lw_license.
    lv_ind = sy-tabix.
    if lv_ind = lv_line.
    append initial line to lt_license.
    endif.
    endloop.
    ENDCASE.
    ENDFORM. "user_command
    reward points if useful
    Rohan

  • Issue in generating space at end of the records.

    Hi All,
        i am working on a outbound flat file interface.i 
        have  a issue in generating the spaces at end of each
        record.
        for ex.,
        My record in the file should contain 80 chars each
        line, in which it will contain values till 74 
        characters and the rest 6 chars should have a blank
        space.
        we were able to generate space in the file using
        class "CL_ABAP_CHAR_UTILITIES".
        But this text file when converted to HEX file, the
        end of the record has values as 20 20 20 20 C2 A0 or
        some junk values.But as per the requirement the HEX
        file should display the end of the record as 20 20 20
        20 20 20.
        Please let me know how i should generate spaces in
        the text file and at the same time proper Records in
        HEX file(i.e., 20(value for space in HEX)).
       Thanks in advance.
       Nanda

    hi,
      empty space at the end of the record will be ignored if you download the file.
    So use an END OF RECORD character like ',' or '.' or some other symbol & give you 6 or 7 characters blank space at the end, will work for you.
    now you will able to see total 80 characters(may be with spaces) & 81st will your END OF RECORD indicator.
    YOur legacy system will take only first 80 characters not the total records (in this case 81)
    regards
    srikanth

  • How to delete blank space from value of Infoobject in the transfer rule

    does anyboady know how to write a routine in the transfer rule in order to delete ending blank spaces from value of Infoobject 'ORDTEXT'. E.g. value: 'ABM    '?  After routine, the result should be 'ABM'.
    Thanks for any input.

    Deleting 'ending blank spaces' from a character type field (ie info-object or text) in SAP is not meaningful. For all usage, a char type field of length 8 having value  'ABM     '  is same as 'ABM'.
    Ok, HTML is changing the display in the above, so let me restate it
    For all usage, a char type field of length 8 having value  'ABM_____'  is same as 'ABM', take the underscore character (_) in the first string as a placeholder for space character.
    Edited by: Ajay Das on Jul 29, 2009 12:07 PM

  • How to use blank space replace NULL on discoverer viewer

    Hi,
    There is a report that has a varchar field should show text values, and if NULL, I need it show blank space, and does in disco desktop, but on viewer, the same worksheet shows NULL.
    Even I changed in the Tools - Options - Format menu(desktop), it still show NULL on viewer.
    why?
    please help! thanks!
    sammy

    Hi Sammy,
    Unfortunately ‘some’ of the settings set in Desktop do not carry over to Viewer. These options need to be defined for Viewer itself.
    A temporary way to set the Viewer settings is to click on ‘Options’ when logged in Viewer itself. You’ll have to open a responsibility or report before this option becomes available to select. Within here you’ll be able to change the way NULL values are seen. However this method only makes the change for the User you logged in with.
    To make the change for all users, it’s best to edit the PREF.TXT file on the Discoverer Server. Please view the documentation below for more information on how to configure Viewer. For windows platform click here : http://download-uk.oracle.com/docs/html/A90287_01/toc.htm,
    For Unix platform click here : http://download-uk.oracle.com/docs/html/A90288_01/toc.htm. Once you’ve run the applypreference script, these settings will be forced down to all users of Discoverer.
    Hopefully this will help ;-)
    Lance

  • How to Remove Blank spaces in the text elements for a smartform

    Hi All,
    Can any one please help me out to remove the blank spaces in the text elements.
    We are printing Labels using the Zebra Printer and we have rotated the windows to 90 degrees.
    We are able to see out text and barcodes. But the issues is when we are printing the label. We are getting spaces in the Text and in the Text elements fields. I have tried to give &g_name(C)&. But it is not working even i worked with style sheet spaces no luck.
    Currently out text and fields are printing like this
    s h r i y a n
    material number
    1111  -001  -000
    They should print like
    shriyan
    1111-001-000
    According to the ZEBRA suggestions we are using the font helve.
    Plase help us it is very urgent.
    Reward point will be given.
    Thanks

    Hi,
    Just use Condense g_name inside the program lines.
    Just to see how it behaves put a hard breakpoint.
    Break Username. and check the condense statement.
    condense <your field> no-gaps.
    Create program lines ahead of printing. give the field you want to condense in the input and output parameters of the program lines.
    Use condense inside the program lines.
    Thanks,
    Vamshi.

  • How to remove blank space left from Images Word import

    Hi all,
    I'm working on a document which has been imported from Word, because of the conversion process a lot of images (that where pasted directly from Powerpoint in Word) didn't get converted properly and ended up in different part of the resulting Pages document.
    The issue is that the images were found somewhere else, but the space they were occupying in the document was left ..sometimes in that space I find a squared frame which I can easily remove but some other times I just find a blank space which is impossible to remove or select.
    This results in breaking the text for 10-13 lines. It is impossible to make the text filling this space. I can assure I cannot select this area with any tool (also by selecting 'make master objects selectable') and Im using the 'show invisibles' mode.
    Please any suggestion or advise?
    Im available to send a part of the document so anyone may check if wants to help me..
    Thanks a lot
    cheers

    Hi Jerry thanks for your possible help , please find below a part of the text Im working, the issue is at the end of page 16 where I highlighted in yellow the text, I cannot get rid of the space at page 16:
    Sorry if the document is in Italian and it is quite understanble for all you..
    http://www.wupload.com/file/2677565317/example_of_my_problem.pages
    I had to put it on wupload  because the file is 77MB, sorry!!!
    ..and I dunno why...the whole document is 264 pages and is 77,8 MB I thought that only 17 pages were less...
    I think thisis another BIG ISSUE thie FILE:.I think there is something hidden in it which is subtracting space...
    Actually whne I imported the original document from Word it became 100MB, then I got rid of all the images but still 77MB, in word it was just 12MB with images..
    Any more idea/suggestions about this size issue please?
    Thanks a lot to everyone
    cheers
    simo
    PS
    in some of the footnotes there are some citation I imported using Endnote x5, but this is not affecting too much the size, as before these citations when I imported the document were not

  • How to validate blank space ?

    Hi All
    I have a textfield i am showing alert if textfield is empty by using isNull and undefined way but how check if user give empty space ?
    Thanks in advance !!!
    Regards,
    Ganesh

    This is how to remove all blank spaces in a string:
    Create a function in an object script, e.g.:
    Script Object Name: myObject
    Method Name : function trim(string)
    function trim(str){
         return str.replace(/^\s+|\s+$/g, '');
    //this function above return the string by replacing blank space by nothing (empty string or null string)
    //it only replace if the field is empty, if there is no chars inside
    //Show the output value after calling the method
    TextField21.rawValue = myObject.trim(TextField21.rawValue);
    //Here is a lil proto to see if it works
    if (TextField21.rawValue == null){
              xfa.host.messageBox("Null");
    } else{
              xfa.host.messageBox("Blank");

  • Reporting -how to get blank space

    Hi friends,
                    I have a report see this format
                       Cusno Cusname   cus address telephone
                           101    sri               102            45454
                            102   har               ####           ####
    In this report we don’t have data for this (cusno 102( cus addr, telephone)) so we are getting some hash symbols in those places but my requirement is we should get some ‘Blank space’ .
             I want to know for this kind of output is there any settings while during modeling or in repoting level.
    Pls suggest me
    Thanks
    ram

    Hi,
    You Can Remove # in workbook by using macro's.
    You Can use the following Code in VB macro to Eliminate #.
    Sub SAPBEXonRefresh(queryID As String, resultArea As Range)
    Dim ws As Worksheet
    Set ws = resultArea.Parent
    resultArea.Select
    'Remove '#'
    Selection.Cells.Replace What:="#", Replacement:="", LookAt:=xlWhole, SearchOrder:=xlByRows, MatchCase:=False, MatchByte:=True
    resultArea(1, 1).Select
    End Sub
    Hope it helps.
    Regards,
    -Vijay

  • How to insert a space in html

    Hello everyone,
    I have looked at a bunch of lines on how to add more space between two words in html but none work.
    I have a marquee and it works, it has two words I would like to separate the words by let's say 8 or 9 spaces
    I tried space
    and a few variations of that style but for some reason it does not work. I guess space must need a value but ...
    Would someone please fix my line.
    Thank you
    Mireille

    Mireille:
    Are you trying to add these spaces to the raw html or in an iWeb text box? If raw are you sure you added the code like this
    & nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp
    removing the spaces from between the & and n characters as Tom mentioned?
    This was done with BBEdit but any text editor can do the same.
    OT

  • How to replace blank spaces with zero's in the report

    hai sdn guys,
                         we have a requirement where we cannot have any blank fields in the report and i need to replace the blanks with a zero. What is the best way to do it.

    Hi Sunitha,
    It is not proper that you are posting the same question multiple times:
    Re: report o/p should not have blank spaces in - in case of no value
    should get 0's in place of blank value in  the output of the report
    That too inspite of my requesting you not to do so.
    I am not sure if you have ever gone through the Rules Of Engagement which are prominently posted in each forum, but I think it is SDN courtesy to provide proper feedback when posting a question and assign points as deemed fit. This helps (and motivates) everyone to work on your problem and try to give you a solution. I hope you will be more careful in the future. Thanks!

  • How to insert sales text (MM02) into a single record of a Ztable.

    Hi,
    I'm extracting data from different data base tables and populating a Ztable which has Matnr as primary key and sales text as a field.
    I have already used READ_TEXT to display the text and it is displayed in multiple records which in turn leads to duplication of Material numbers.
    Now I want to avoid duplication of records (Matnr) as this being a primary record, and display the sales text of a particular material number into one single record.
    Can anyone tell me how to insert sales text (MM02) transaction into one single record.
    Thanks,
    Govind

    sorry i am not enough clear about your requirement...
    as i can understand i am explaining to you.
    suppose your itab contains repaeating matnr.
    matnr
    1
    1
    2
    2
    2
    3
    3
    like this.
    data : text(200),
             matnr like mara-matnr.
    loop at itab.
    call READ_TEXT fnmodule.
    loop at tline.
    concatenate text tline-tdline into text.
    endloop.
    matnr = itab-matnr.
    at end of matnr.
    itab1-matnr = matnr.
    itab1-text = text.
    append itab1.
    clear text.
    endat.
    endloop.
    NB change the code as per your requirement
    regards
    shiba dutta

Maybe you are looking for

  • Display xero as zero and null as space in BEx excel reports - urgent

    How do I set query properties, where difference of 2 key figures is if zero will display zero. but if there is a key figure which has a null value (not assigned), then difference between 2 KFs will be space. Thanks Swati

  • Receive mail but can't send.

    I can access and send mail through the web but the 'home' application won't allow me to send emails because it won't accept my password. I can't figure out how to change my password. Each time I do I get sent in a spiral -- the password is the same o

  • Update newly added IO in Cube.. ABAP help ?

    Hi Experts, Need some help here.  I'm trying to write my first abap code.  I have been reading the forum here and trying to understand some abap logic.  The scenario is, I have added another field in my cube: CALMTH2, which I basically am trying to p

  • Address Book - Title of a person is missing  when entry has no first name

    In Address Book - the title (prefix) of a person is missing when the contact has no first name. This is an issue both in the way that the names are displayed in the 'name' panel of Address Book, but more importantly when I print out a list of contact

  • Does BOE XI 3.1 API supports COMPLIED in JDK 1.4.x?

    Hi, It's known  that the JAVA environment for BOE XI 3.1 is JDK 1.6.x. But due to unified programming version control, the client's original application is developed and complied in JDK 1.4.x. So they only provide development environment for JDK 1.4.