04-17-2020 8:01 PM
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?
04-21-2020 9:31 AM
>> 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.
I cannot understand how your 'assignment' is by any chance fullfilled by the coding you have presented.
>> If you have experience in this, do you mind sharing a better way of doing this?
This is a very open question. What is your actual problem or what do you want to improve or what are you unsure about?
In regards to your coding, I could leave a comment for pretty much every line of code you have presented.
04-21-2020 10:36 AM
I suggest that before you post more questions with the same errors, you address the answers given here:
https://answers.sap.com/questions/13028306/bapiret2-message-not-showing.html
05-13-2020 4:14 PM
arnold92, please follow up on your open question.