Sunday, March 20, 2011

Example of using Substring in ABAP Programming

REPORT  Z_STUFFING_REPORT.

TABLES:   MARA.
       

select single * from MARA where ERSDA = '04/3/2011'.


DATA: LIN TYPE I,
        tues1 TYPE i,
        tues2 TYPE i,
        total_tues TYPE i.
 

DESCRIBE TABLE MARA LINES LIN.
 

Loop at MARA.
    DESCRIBE TABLE MARA LINES LIN.
    s = MARA-MATKL+0(1).
    IF s = '2'.
      tues1 = tues1 + 1.
    else.
      tues2 = tues2 + 2.
    ENDIF.
  endloop.

total_tues = tues1 + tues2.

write:/ 'Total Tues: ', total_tues.

1 comment:

  1. Nice blog....For a long time I was looking for SAP ABAP training in Chennai and got the link


    THE CREATING EXPERTS is providing SAP BASIS training in real time

    http://thecreatingexperts.com/sap-abap-training-in-chennai/

    Contact 8122241286

    ReplyDelete