Skip to Content
author's profile photo Former Member
Former Member

Problem in printing invoice number

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Oct 11, 2005 at 03:31 AM

    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).

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 09, 2005 at 03:43 AM

    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.)

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 11, 2005 at 03:24 AM

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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member
      • 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.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.