Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Query regarding alignment of data in Application server

Former Member
0 Likes
703

My requirement is to download data to the application server. To get an aligned output, i need to give offset position manually for each input.

For example :

lw_outtab+0(15) = in_itab-matnr.

lw_outtab+25(10) = in_itab-vkorg.

append lw_outtab to i_outtab.

Instead of manualy giving the offset position

Is there is any function module to get an aligned output in the Application server directly.

And also i would like to know if color formating is possible for the downloaded data.

...Waiting for ur suggestions.

Regards,

Dhana...

1 ACCEPTED SOLUTION
Read only

andreas_mann3
Active Contributor
0 Likes
624

Hi,

You can use field-symbols

field-symbols <f>.

Data trenn value ';'.

do.

assign component sy-index of structure in_itab to <f>.

IF SY-SUBRC <> 0.

EXIT.

ENDIF.

concatenate lw_outtab <f> trenn into lw_outtab .

enddo.

Append lw_outtab to i_outtab.

regards Andreas

Hi,

You can use field-symbols

field-symbols <f>.

Data trenn value ';'.

do.

assign component sy-index of structure in_itab to <f>.

IF SY-SUBRC <> 0.

EXIT.

ENDIF.

concatenate lw_outtab <f> trenn into lw_outtab .

enddo.

Append lw_outtab to i_outtab.

regards Andreas

3 REPLIES 3
Read only

andreas_mann3
Active Contributor
0 Likes
625

Hi,

You can use field-symbols

field-symbols <f>.

Data trenn value ';'.

do.

assign component sy-index of structure in_itab to <f>.

IF SY-SUBRC <> 0.

EXIT.

ENDIF.

concatenate lw_outtab <f> trenn into lw_outtab .

enddo.

Append lw_outtab to i_outtab.

regards Andreas

Read only

Former Member
0 Likes
624

Hi Dhanachezhiyan,

In order to get alligned data in an outputfile to application server you could do something like this:

  • Define your own types (of course you can add as much fields you need)

TYPES: BEGIN OF ty_in_itab,

matnr(15) TYPE c,

buf01(10) TYPE c,

vkorg(10) TYPE c,

buf01(10) TYPE c,

END OF ty_in_itab,

  • Make sure that the length here is equal to length of ty_in_itab

ty_outtab(100) TYPE c.

  • Define your own tables/workarea's

DATA: in_itab TYPE ty_in_itab OCCURS 0 WITH HEADER LINE,

in_outtab TYPE ty_outtab OCCURS,

lw_outtab TYPE ty_outtab.

  • Logic to fill in_itab.

  • ...

MOVE CORRESPONDING VBAK TO in_itab.

APPEND in_itab.

  • ...

  • After this filling logic do your trick

LOOP AT in_itab.

lw_outtab = in_itab.

APPEND lw_outtab TO in_outtab.

ENDLOOP.

  • And afterwards download it

  • ...

Hope this sample will help you along.

Regards,

Rob.

Read only

0 Likes
624

Thanks Andreas, Rob for ur info.