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

How to write message?

Hi,

I have a problem in writting message after downloading. When the records of Customer download successful, the message" Customer code 1111111 download OK' will showed.

With the coding I wrote, Just only one customer code showed in the download message, and the other customer code which were download successful could not been showed.

Question: I need to show all the successful downloaded customer code, How can I correct the folloing coding?

Please help, thank you.

-


Data: anz_dl1(15) type n,

anz_dl2(15) type n.

BEGIN OF HTEXT1,

text1(30) VALUE 'customer code',

anzahl1(150),

text3(20) VALUE ' DOWNLOAD NG',

END OF HTEXT1,

BEGIN OF HTEXT2,

text3(30) VALUE 'customer code',

anzahl2(150),

text4(20) VALUE ' DOWNLOAD OK',

END OF HTEXT2.

CLEAR anz_dl1.

CLEAR htext1-anzahl1.

WRITE T1-KUNNR TO anz_dl1.

WRITE T-KUNNR TO anz_dl2.

WRITE anz_dl1 to htext1-anzahl1.

CONDENSE htext1.

WRITE anz_dl2 to htext2-anzahl2.

CONDENSE htext2.

IF p_downl = 'X'.

SKIP 2.

WRITE: / htext1.

SKIP 2.

WRITE:/ htext2.

-


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 12:50 AM

    Hi.

    Declare two tables for each of the structures and add rows with Your data to them.

    Latter make a loop at the tables with the CONDESE and display Your data.

    Hope it helps.

    -


    Data: anz_dl1(15) type n,

    anz_dl2(15) type n,

    BEGIN OF HTEXT1,

    text1(30) VALUE 'customer code',

    anzahl1(150),

    text3(20) VALUE ' DOWNLOAD NG',

    END OF HTEXT1,

    BEGIN OF HTEXT2,

    text3(30) VALUE 'customer code',

    anzahl2(150),

    text4(20) VALUE ' DOWNLOAD OK',

    END OF HTEXT2,

    HTEXT1_TAB like TABLE OF HTEXT1,

    HTEXT2_TAB like TABLE OF HTEXT2.

    CLEAR anz_dl1.

    CLEAR htext1-anzahl1.

    WRITE T1-KUNNR TO anz_dl1.

    WRITE T-KUNNR TO anz_dl2.

    WRITE anz_dl1 to htext1-anzahl1.

    APPEND htext1 to htext1_tab.

    WRITE anz_dl2 to htext2-anzahl2.

    APPEND htext2 to htext2_tab.

    IF p_downl = 'X'.

    LOOP AT htext1_tab INTO htext1.

    CONDENSE htext1.

    SKIP 2.

    WRITE: / htext1.

    ENDLOOP.

    LOOP AT htext2_tab INTO htext2.

    CONDENSE htext2.

    SKIP 2.

    WRITE:/ htext2.

    ENDLOOP.

    ENDIF.

    -


    Regards,

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      '0000000' values for kunnr is appearing due to the field anz_dl1. as this field is numeric, if t1-kunnr is blank, it is considering as zeros. and once again u r passing this numeric field to htext1-anzahl1. Hence zeros are displayed.

      Do you want to avoid the display of records with kunnr value zeros?

      Try as follows:

      CLEAR anz_dl1.

      LOOP AT t1.

      WRITE t1-kunnr TO anz_dl1.

      If anz_dl1 is initial. (If anz_dl1 is zeros then continue with next record)

      continue.

      endif.

      WRITE anz_dl1 TO htext1-anzahl1.

      APPEND htext1 TO htext1_tab.

      ENDLOOP.

      SORT htext1_tab BY anzahl1.

      DELETE ADJACENT DUPLICATES FROM htext1_tab COMPARING anzahl1.

      CLEAR anz_dl2.

      LOOP AT t.

      WRITE t-kunnr TO anz_dl2.

      If anz_dl2 is initial.

      continue.

      endif.

      WRITE anz_dl2 TO htext2-anzahl2.

      APPEND htext2 TO htext2_tab.

      ENDLOOP.

      SORT htext2_tab BY anzahl2.

      DELETE ADJACENT DUPLICATES FROM htext2_tab COMPARING anzahl2.

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 01:36 AM

    Hi

    Why you see only single message is :

    You are writing the message only once .

    Your code is not written under any LOOP...ENDLOOP.

    To get all the customer message build an internal table and write your message .

    Hope it helps.

    Thanks

    Praveen

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 04:27 AM

    Hello

    Do like this..

    SORT T1 BY KUNNR .

    DELETE ADJACENT DUPLICATES FROM t1 COMPARING kunnr .

    Hope it helps.

    Praveen

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 04:59 AM

    HI

    WRITE anz_dl1 TO htext1-anzahl1.

    APPEND htext1 TO htext1_tab.

    .

    WRITE anz_dl2 TO htext2-anzahl2.

    APPEND htext2 TO htext2_tab.

    Why u are using this code...any specific purpose ...

    get rid of it .

    Praveen

    Add a comment
    10|10000 characters needed characters exceeded

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.