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

Doubt on Quantity Field

Former Member
0 Likes
1,447

Hi gurus,

I have one quantity field NSOLA in LTAP table for that fields there is reference field ALTME.

Now i am generating one ALV report.In that field catalog i mentioned as

wa_fieldcat-fieldname = 'NSOLA'.

wa_fieldcat-tabname = 'T_OUTPUT'.

wa_fieldcat-seltext_l = 'Quantity'.

wa_fieldcat-qtabname = 'LTAP'.

wa_fieldcat-qfieldname = 'ALTME'.

wa_fieldcat-col_pos = 5.

APPEND wa_fieldcat TO it_fieldcat.

CLEAR wa_fieldcat.

like this, even thogh in o/p i get as 1.000 like that but i want the quantity as 1.

Please suggest me how to do this.

Thanks in Advance

Thanks and Regards,

Siri.....

9 REPLIES 9
Read only

Former Member
0 Likes
1,306

Hi,

Generally qty fields should be displayed with 3 dec. I think there is no affect with reference field.

If u want to remove decimal part, check for any conversion exit or remove decimal part manually like

split field1 at '.' into......

Regards,

Subbu

Read only

Former Member
0 Likes
1,306

Please check it

TABLES : mara.

DATA : BEGIN OF itab OCCURS 0,

matnr LIKE mara-matnr,

brgew TYPE p DECIMALS 0, " this qty file for mara table

sell(1),

END OF itab.

INCLUDE icons.

TYPE-POOLS : slis.

DATA : t_fieldalv TYPE slis_t_fieldcat_alv,

t_sort TYPE slis_t_sortinfo_alv WITH HEADER LINE,

import_variant LIKE disvariant,

xrepid LIKE sy-repid,

layout TYPE slis_layout_alv,

table TYPE c,

dbcnt TYPE i,

dbcntr(10) TYPE c.

DATA : events TYPE slis_t_event WITH HEADER LINE.

START-OF-SELECTION.

CLEAR : itab,itab[].

SELECT * FROM mara INTO CORRESPONDING FIELDS OF TABLE itab WHERE

matnr = 'A036119719501003'.

IF sy-subrc = 0.

PERFORM initial_alv_fieldcat CHANGING t_fieldalv[].

PERFORM layout_alv CHANGING layout.

PERFORM alv_display

TABLES itab

t_fieldalv

t_sort

USING 'Weld Process'

dbcntr

'Weld Process'

' ' "'status'

layout "'layout'

' '." usercommand

ENDIF.

&----


*& Form initial_alv_fieldcat

&----


  • text

----


  • <--P_T_FIELDALV[] text

----


FORM initial_alv_fieldcat CHANGING rt_fieldcat TYPE

slis_t_fieldcat_alv.

DATA: ls_fieldcat TYPE slis_fieldcat_alv.

DATA: i_color TYPE slis_t_specialcol_alv WITH HEADER LINE.

DATA:cntr TYPE i VALUE 1.

CLEAR : rt_fieldcat,rt_fieldcat[].

DEFINE fieldcat.

ls_fieldcat-fieldname = &1.

ls_fieldcat-seltext_m = &2.

append ls_fieldcat to rt_fieldcat.

END-OF-DEFINITION.

fieldcat 'MATNR' 'MATNR'.

fieldcat 'BRGEW' 'BRGEW'.

ENDFORM. " initial_alv_fieldcat

&----


*& Form layout_alv

&----


  • text

----


  • <--P_LAYOUT text

----


FORM layout_alv CHANGING p_layout TYPE slis_layout_alv.

p_layout-box_fieldname = 'SELL'.

p_layout-colwidth_optimize = 'X'.

p_layout-zebra = 'X'.

ENDFORM. " layout_alv

&----


*& Form alv_display

&----


  • text

----


  • -->P_ITAB text

  • -->P_T_FIELDALV text

  • -->P_T_SORT text

  • -->P_0111 text

  • -->P_DBCNTR text

  • -->P_0113 text

  • -->P_0114 text

  • -->P_LAYOUT text

  • -->P_0116 text

----


FORM alv_display

TABLES p_i_weldnew

p_t_fieldalv

p_t_sort

USING p_grid_title

p_count

p_title

p_status

p_layout

p_usercommand.

CONCATENATE p_title ' -


' p_count INTO sy-title.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

i_callback_program = sy-repid

i_callback_pf_status_set = p_status

i_callback_user_command = p_usercommand

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

i_grid_title = p_grid_title

  • I_GRID_SETTINGS =

is_layout = p_layout

it_fieldcat = p_t_fieldalv[]

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

it_sort = p_t_sort[]

  • IT_FILTER =

  • IS_SEL_HIDE =

  • i_default = 'X'

i_save = 'A'

  • IS_VARIANT =

it_events = events[]

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • I_HTML_HEIGHT_TOP =

  • I_HTML_HEIGHT_END =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

t_outtab = p_i_weldnew.

ENDFORM. " alv_display

Read only

Former Member
0 Likes
1,306

the field is defined as 13,3 right. So try to display the integer, i mean you can either convert the decimal to an integer using a different variable.

Thanks,

Anil

Read only

Former Member
0 Likes
1,306

Also add this

wa_fieldcat-datatype = 'QUAN'

Read only

Former Member
0 Likes
1,306

hi,

I that case u can change the type of NSOLA field to integer in the internal table which u r displaying

try out this sample code and see the change in output

tables LTAP.

data : temp like LTAP-NSOLA value '1'.

data: var type i.

var = temp.

write : / 'INTEGER TYPE : ' ,var.

write : / "LTAP-NSOLA :' ,temp.

reward points if useful

Read only

Former Member
0 Likes
1,306

Hi,

Either use SPLIT command to separate the fraction and decimal or declare the quantity field as TYPE i.

Reward if helpful.

Regards,

ramya

Read only

Former Member
0 Likes
1,306

Hi gurus,

Thanks for all for giving valuable suggestions and good support.This question is solved by my self only.It is solved by using the reference quantity field only..

Thanks and Regards

Srihari..

Read only

0 Likes
1,306

hi,

then why dont u give that solution..... here so that even we can knw that.....

thanks

Read only

0 Likes
1,306

Hi Abhinav,

I am also facing the same problem . Can u please explain how you solved this issue.

Thanks in Advance

Shrikanth