Skip to Content
author's profile photo Former Member
Former Member

Need some help on formatting techniques used in excel sheets

Hi All

I have to convert the data in the internal table to a certain format XXXXXX and need to perform mapping for the same.

I got stuck at a point were in i need to follow certain rules to achieve that format like

1. left justify character fields

2. right justify numeric values

3. right justify amount decimal point and 2 decimal places not to use commas and $ symbol.

4.Null values need to be blank.

Can anyone plz send me the code for the following rules as i have never worked on this kind of requirement.

Helpfull answers will be awarded.

plz help me...

thanks,

Message was edited by:

skk

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 01:24 PM

    while writing values from internal table...

    1. left justify character fields <b>use left-justified</b>

    2. right justify numeric values <b>use right-justified</b>

    3. right justify amount decimal point and 2 decimal places not to use commas and $ symbol. <b>use right-justified</b>

    4.Null values need to be blank. <b>use space</b>

    Award Points

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 01:27 PM

    Read file as follows - save ur file as text tab.make changes to the code as per ut Internal table

    parameters: p_file like rlgrap-filename default 'C:\temp\emp.txt'.

    data :begin of itab occurs 0,

    pernr(8),

    bdate(10),

    edate(10),

    mail(30),

    end of itab.

    start-of-selection.

    perform read_file.

    loop at itab.

    if itab-pernr GT '1'.

    Stop.

    endif.

    endloop.

    End-of-selection.

    message e000(000) with 'Duplicate Company Code'.

    FORM read_file .

    DATA: full_file_name TYPE string.

    full_file_name = p_file.

    CALL FUNCTION 'GUI_UPLOAD'

    EXPORTING

    FILENAME = full_file_name

    FILETYPE = 'ASC'

    HAS_FIELD_SEPARATOR = ','

    • HEADER_LENGTH = 0

    • READ_BY_LINE = 'X'

    • DAT_MODE = ' '

    • CODEPAGE = ' '

    • IGNORE_CERR = ABAP_TRUE

    • REPLACEMENT = '#'

    • CHECK_BOM = ' '

    • NO_AUTH_CHECK = ' '

    • IMPORTING

    • FILELENGTH =

    • HEADER =

    TABLES

    DATA_TAB = itab

    EXCEPTIONS

    FILE_OPEN_ERROR = 1

    FILE_READ_ERROR = 2

    NO_BATCH = 3

    GUI_REFUSE_FILETRANSFER = 4

    INVALID_TYPE = 5

    NO_AUTHORITY = 6

    UNKNOWN_ERROR = 7

    BAD_DATA_FORMAT = 8

    HEADER_NOT_ALLOWED = 9

    SEPARATOR_NOT_ALLOWED = 10

    HEADER_TOO_LONG = 11

    UNKNOWN_DP_ERROR = 12

    ACCESS_DENIED = 13

    DP_OUT_OF_MEMORY = 14

    DISK_FULL = 15

    DP_TIMEOUT = 16

    OTHERS = 17

    .

    IF SY-SUBRC <> 0.

    MESSAGE e000(000) WITH 'Upload-Error; RC:' sy-subrc.

    ENDIF.

    ENDFORM. " read_file

    Award points and close duplicate threads

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.