cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in printing invoice number

Former Member
0 Kudos

Hi Friends,

Iam facing 1 problem in SAP script.I want to print Invoice number with leading zeros.In my print program the internal table is populating with leading zero,but when it comes to form it is having value without leading zero.for eg. Itab_remittance-invoice is 01000000 in print prog. when it come is to form its value is 100000.The datatype is char. of length 8. If i move the field to a temp.variable (N or I) the value is populating in print programing but it is not populating in the form. So help me to solve this problem.

Rgds,

Rama

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Does it has any conversion routine associated with it? If so, remove the association, then it should work. Let us say if your Itab_remittance-invoice is defined 'LIKE VBRK-VBELN', then remove that reference and define it just as char(10).

Former Member
0 Kudos

Instead of INVOICE LIKE ZSAP_INVOICE-NEW_VBELN,Now i gave INVOICE(8) TYPE N.It is working.Srini Can you tell me the reason why it is not working with v_temp.

Former Member
0 Kudos

It will work with v_temp but I think v_temp is not a field on your sapscript form. I think you use the internal table field in the form.

If resolved, could you please reward and close the post.

Srinivas

Former Member
0 Kudos

In my form i gave &V_TEMP& But it is populating blank value whereas for &ITAB_REMITTANCE-INVOICE& it is populating 01000000.If possible mail me the reason so that i can close the issue by rewarding points to you.

Former Member
0 Kudos

Aren't you printing an internal table ITAB_REMITTANCE records? V_TEMP is not a field of an internal table, so in the loop, it probably doesn't know how to print it. I cannot really tell with just this information.

Answers (2)

Answers (2)

Former Member
0 Kudos

No ya i tried this, but it is not populating the value in SAP Script.

Former Member
0 Kudos

Can you paste code of your data type definition and the coding to move values in print program . You didnot mention which of the two options did not work.

Cheers

Former Member
0 Kudos
  • To store Remittance Advice details

DATA: BEGIN OF ITAB_REMITTANCE OCCURS 0,

INVOICE LIKE ZSAP_INVOICE-NEW_VBELN,

INVOICE_DATE LIKE ZSAP_INVOICE-INVOICE_DATE,

ACCOUNT LIKE ZSAP_INVOICE-PAYER,

NAME LIKE KNA1-NAME1,

TOT_PAST_DUE LIKE ZSAP_BALFWD-TOT_PAST_DUE,

DOC_CHARGES LIKE ZSAP_BALFWD-DOC_CHARGES,

DOC_TOTAL_DUE LIKE ZSAP_BALFWD-DOC_TOTAL_DUE,

END OF ITAB_REMITTANCE.

ZSAP_INVOICE-NEW_VBELN is of type c and length 8

DATA : V_TEMP(8) TYPE N.

LOOP AT ITAB_REMITTANCE.

WRITE ITAB_REMITTANCE-INVOICE TO V_TEMP.

ENDLOOP.

The value(1000000) is populating without leading zero in V_TEMP in print program whereas in Script it is populating as blank value.

Former Member
0 Kudos

Hi Ramadevi,

Instead of "MOVE" use "WRTIE TO" to pass data into Itab_remittance-invoice .

WRITE <INVOICE_NUM> TO Itab_remittance-invoice .

( <INVOICE_NUM> should be of type N. If your invoice number is of type NUMC then first pass it to type N field ( temporary work area ) and then use "WRITE TO" in program )

Or directly use the SAP std field for invoice number on

sapscript like &<INVOICE-NUM>(K)& . The leading 0s are deleted due to conversion defined in dictionary . With this way you can Ignore conversion routines.

Cheers.

( Don't forget to reward if answers were helpful.)