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

Unit not displayed correctly

Former Member
0 Likes
1,768

Hi All,

        I am executing an ALV report in background and when I check the unit field it is displayed as '******'. But when I execute the report in foreground the unit is appearing correctly. Please could someone let me know why the unit is displayed as  '******' in background and how to correct it.

Thanks in advance,

Priya


1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,712

Can you post definition of the unit fields in the internal table, actually unit fields are 3 character length internally and externally with conversion-exit CUNIT.

Do you actually fill it with correct data ?

(Sometimes ALV is able to correct such errors as external value in fields that should contain internal values, but not always)

Regards,

Raymond

9 REPLIES 9
Read only

rajkumarnarasimman
Active Contributor
0 Likes
1,712

Hi Priya,

Are you using the control break statement(AT NEW... ENDAT, AT END OF... ENDAT).

Because Inside the control break statements only the value will be displayed as *****

Regards

Rajkumar Narasimman

Read only

0 Likes
1,712

Hi Rajkumar,

         No I am not using control break statements. I can see the Unit correctly when executing the report in Foreground. The problem is only if the report is executed in background. Please some one help.

Thanks,

Priya

Read only

0 Likes
1,712

Hi,

can please show how you declare this field in your itab

and do you declare this field in fieldcat (ALV).

Do you set SELTEXT_M, or _S or _L ?

Regards, Dieter

Read only

0 Likes
1,712

Hi Dieter,

         I am declaring unit in the fieldcat as below:

PERFORM set_fieldcat USING 'MEINH'     10 text-o08 '23' 'L' space. 

FORM set_fieldcat  USING    p_field p_length p_text p_pos p_just p_nozero.

  CLEAR wa_fcat.
  wa_fcat-fieldname = p_field.         

  wa_fcat-tabname   = 'IT_OUTPUT'.
  wa_fcat-outputlen = p_length.
  wa_fcat-seltext_m = p_text.
  wa_fcat-col_pos   = p_pos.
  wa_fcat-just      = p_just.
  wa_fcat-no_zero   = p_nozero.
  APPEND wa_fcat TO it_fcat.

   ENDFORM.                    " SET_FIELDCAT

Please could you help why the unit is not displayed correctly in background?

Thanks,

Priya

Read only

Former Member
0 Likes
1,712

Hi priya,

check that the data type is same for internal table field "ie for IT_OUTPUT" and text-008.

Thanks.


Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,713

Can you post definition of the unit fields in the internal table, actually unit fields are 3 character length internally and externally with conversion-exit CUNIT.

Do you actually fill it with correct data ?

(Sometimes ALV is able to correct such errors as external value in fields that should contain internal values, but not always)

Regards,

Raymond

Read only

0 Likes
1,712

Hi Raymond,

       I am defining the unit as

    meinh      TYPE mara-meins,

I am using    'CONVERSION_EXIT_CUNIT_OUTPUT' to display unit in ALV report. Is this causing some problem while the report is executed in background?

Thanks,

Priya

Read only

0 Likes
1,712

Execute a Consistency Check during interactive display of the grid. Check in field catalog if the unit field carry the conversion-exit, if yes you are asking the ALV to convert some already converted data, and the background version of ALV rely on older code (as of REUSE ALV LIST FM) that was not always able to correct the error.

So don’t convert the data, let SAP do it, also if you reference some quantity with this field, the ALV may get in trouble for some exotic unit (As it currently is often not able to identify the unit attributes to display quantity, hopefully most quantity fields don’t actually need this option)

NB: If you don’t use the unit as a reference for quantity, you can keep on converting the value, but insure that the field catalog will not contain the conversion-exit, do not give any ddic reference in the field definition.

Regards,

Raymond

PS: Also reduce output length to 3 and not 10, Else ALV may consider there is no enough space to display the field...

Read only

0 Likes
1,712

Thanks Raymond. I removed the conversion exit and its displaying correctly in background.