Skip to Content
-7
A S
Apr 17, 2020 at 07:01 PM

Not showing entries when execute source code in Class

54 Views

Hi im given an assignment to create, say purchase order entry using class (Encapsulate data in class method based on MVC design principles, in this case it is create operation). The table type is actually storing my zekko and zekpo.

Parameter declaration are in the screenshot.

This is the source code

if LV_ZEKKO03_COUNTS > 0 AND LV_ZEKPO03_COUNTS > 0.
    es_bapiret2-type = 'S'.
    es_bapiret2-id = 'Success'.
    es_bapiret2-number = '003'.
    es_bapiret2-message = 'Row(s) inserted'.
       select mandt ebeln bedat bsart lifnr waers knumv
  FROM ekko into CORRESPONDING FIELDS OF table it_zheader.
         INSERT zekko03 FROM table it_zitems.
         lv_zekpo03_counts = LINES( it_zitems ).


  SELECT mandt ebeln ebelp bukrs werks matnr menge meins netpr
  FROM ekpo INTO CORRESPONDING FIELDS OF TABLE it_zitems.

INSERT zekpo03 FROM TABLE it_zitems.
lv_zekpo03_counts = lines( it_zitems ).

else.
      es_bapiret2-type = 'E'.
    es_bapiret2-id = 'Error'.
    es_bapiret2-number = '004'.
    es_bapiret2-message = 'No row(s) added'.

endif.

If you have experience in this, do you mind sharing a better way of doing this?

Attachments

capture.png (13.8 kB)