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

To format batch no

Former Member
0 Likes
1,125

Hi Experts,

I am concatenating number range status which field name is NRLEVEL with sy-datum in which i am taking first two digit of date and month and last digit of NRLEVEL from table NRIV of length 10 to generate new number which i have to assume batch number.

i used:

IF SY-SUBRC = 0.

CONCATENATE SY-DATUM+2(2)

SY-DATUM+4(2) INTO DATE. "GET DATE FORM CURRENT DATA

IF WA_FINAL-NRLEVEL IS NOT INITIAL.

BATNO = WA_FINAL-NRLEVEL+19(1).

CONCATENATE DATE '00000' BATNO INTO WA_FINAL-NRLEVEL1.

ENDIF.

MODIFY IT_FINAL FROM WA_FINAL INDEX IDX TRANSPORTING NRLEVEL1.

ENDIF.

In debugging its coming correct length 10 digit as 0906000004 but in alv print its giving 906000004 output.

so how can i solve this problem.

thank you.

7 REPLIES 7
Read only

Former Member
0 Likes
1,067

Hi Saalim,

Change the ALV field to character type.

George

Read only

Former Member
0 Likes
1,067

set this component of field-cat "lzero"...

Read only

0 Likes
1,067

Hi,

i added lzero like this but still it not solved so please check this is it correct or not.

WA_FCAT-COL_POS = 4.

WA_FCAT-FIELDNAME = 'NRLEVEL1'.

WA_FCAT-SELTEXT_M = 'CURRENT LOT NO'.

WA_FCAT-TABNAME = 'IT_FINAL'.

WA_FCAT-LZERO = ' '.

APPEND WA_FCAT TO IT_FCAT.

thanks.

Read only

0 Likes
1,067

Try all possibilities....

WA_FCAT-LZERO = ' X'. ???

Read only

0 Likes
1,067

Hi!

I agree with Veeranji Reddy, you have to asign 'X' to WA_FCAT-LZERO .And it will work!

wa_fcat-lzero = 'X'.

Read only

0 Likes
1,067

Sorry, i have forgotten to say that there are 2 possibilities:

1-Your variable has type c (you don´t have to use lzero)

2-Your variable hast type n and you have to use lzero

Read only

Former Member
0 Likes
1,067

Hi,

Make sure that BATNO have declared as a CHAR type in declaration and try to make the process.

Regards

Thiru