Professional Documents
Culture Documents
BOPF-Baic - Oct PDF
BOPF-Baic - Oct PDF
ByDesign BOPF
Agenda
1.
Introduction
2.
3.
Message Concept
4.
Introduction
What is a framework?
Frameworks are similar to software libraries in that they are reuseable abstractions of code
wrapped in a well-defined API. Unlike libraries, however, the overall program's flow of control
is not dictated by the caller, but by the framework. This inversion of control is the
distinguishing feature of software frameworks.
(Source: Wikipedia.com)
Introduction
Inversion of control means for example, BOPF calls the action implementation, which
you have implemented, if this action is called by the consumer.
If you implement a BOPF entity (e.g. action or determination), the framework
provides you a context for model information and access objects to access the data
of business object node instances.
Agenda
1.
Introduction
2.
3.
Message Concept
4.
io_read->retrieve(
EXPORTING
iv_node
it_key
IMPORTING
et_data
= if_bopf_customer_invoice_19_c=>sc_node-item
= it_key
= lt_item_data ).
iv_node: Specified the business object node for which data shall be retrieved. In this
example we want the data from node ITEM.
et_data: Internal table, which contains the node data for the requested instances. Table is
of the combined table type specified for the node in the BOPF model.
Example of Retrieve()
BO Instance
(Test Shell)
BO Model
(CONF UI)
Input Parameter
IV_NODE
8003BAE58F691DEB9688BEFD50A1D616
IT_KEY
00000000000102DC9BAFC085F3AA808B
00000000000102DC9BAFC0EFD63940AA
00000000000102DC9BAFCA210B88410F
Output Parameter
io_read->retrieve_by_association(
EXPORTING
IV_NODE
= ZIF_CI00_BOPF_C=>sc_node-root
IT_KEY
= it_key
IV_ASSOCIATION = ZIF_CI00_BOPF_C=>SC_ASSOCIATION-root-item
IV_FILL_DATA
= abap_true
IMPORTING
ET_DATA
= lt_item_data ).
it_key: Table of keys of node instances for which instances of the associations should be
used to get their corresponding target instance keys.
iv_filled_key: If it is true, then ET_DATA is exported and contains the instance data
(typed as the combined table structure of the target node of that association)
Example of Retrieve_By_Assocation()
BO Instance
(Test Shell)
BO Model
(CONF UI)
Input Parameter
IV_NODE
IV_ASSOCIATION
8003BAE58F691DEB9688BEFD50A1D616
8003BAE58F691DEB9688BF02187490BF
IT_KEY
00000000000102DC9BAE8CE2DD7D01B5
00000000000102DC9BAE8CF600FB01D1
Output Parameter
ET_TARGET
00000000000102DC9BAFC085F3AA808B
00000000000102DC9BAFC0EFD63940AA
00000000000102DC9BAFCA210B88410F
00000000000102DC9BAFC9AA6DC2C0F3
ET_KEY_LINK
Sources:
Targets:
(00000000000102DC9BAE8CE2DD7D01B5, 00000000000102DC9BAFC085F3AA808B)
(00000000000102DC9BAE8CE2DD7D01B5, 00000000000102DC9BAFC0EFD63940AA)
(00000000000102DC9BAE8CE2DD7D01B5, 00000000000102DC9BAFCA210B88410F)
(00000000000102DC9BAE8CF600FB01D1, 00000000000102DC9BAFC9AA6DC2C0F3)
Agenda
1.
Introduction
2.
3.
Message Concept
4.
io_modify->update(
EXPORTING
iv_node
= if_bopf_customer_invoice_19_c=>sc_node-item
iv_key
= ls_item_data->key
is_data
= ls_item_data ).
iv_node: Specified the business object node for which data shall be updated. In this
example we want to update the data from node ITEM.
iv_key: Key of the instance to be updated
is_data: Reference to the data the instance shall be updated with. Reference has to point to
a variable typed with the combined structure type of the node.
io_modify->update(
EXPORTING
iv_node = if_bopf_customer_invoice_19_c=>sc_node-item
iv_key = ls_item_data->key
is_data = ls_item_data ).
Agenda
1.
Introduction
2.
3.
4.
/BOPF/CM_FRW
CM_SCM_XYZ
CM_BOPF_TRAINING
MS_ORIGIN_LOCATION
MV_CURRENCY_CODE
" 3. Get message container or create one (but only, if it wasnt done before!)
IF eo_message IS NOT BOUND.
CALL METHOD /bopf/cl_frw_factory=>get_message
RECEIVING
eo_message
= eo_message.
ENDIF.
Agenda
1.
Introduction
2.
3.
4.
The BOPF Performance Guideline contains hints, how you can speed up your
business object implementations
https://wiki.wdf.sap.corp/display/BOPF/BOPF+Performance+Guideline
Example
One io_read->retrieve() call for all keys before loops, instead of placing it into the loop
LOOP AT it_key INTO ls_key.
CLEAR lt_key.
APPEND ls_key TO lt_key.
io_read->retrieve(
EXPORTING it_key = lt_key
IMPORTING et_data = lt_node ).
...
ENDLOOP.
io_read->retrieve(
EXPORTING it_key = it_key
IMPORTING et_data = lt_node ).
LOOP AT lt_node INTO ls_node.
...
ENDLOOP.
Questions?
Thank you!
Weitergabe und Vervielfltigung dieser Publikation oder von Teilen daraus sind, zu welchem Zweck und in welcher Form auch immer, ohne die ausdrckliche schriftliche Genehmigung durch
SAP AG nicht gestattet. In dieser Publikation enthaltene Informationen knnen ohne vorherige Ankndigung gendert werden.
Einige von der SAP AG und deren Vertriebspartnern vertriebene Softwareprodukte knnen Softwarekomponenten umfassen, die Eigentum anderer Softwarehersteller sind.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, Duet, Business ByDesign, ByDesign, PartnerEdge und andere in diesem Dokument erwhnte SAP-Produkte und Services
sowie die dazugehrigen Logos sind Marken oder eingetragene Marken der SAP AG in Deutschland und in mehreren anderen Lndern weltweit. Alle anderen in diesem Dokument erwhnten
Namen von Produkten und Services sowie die damit verbundenen Firmenlogos sind Marken der jeweiligen Unternehmen. Die Angaben im Text sind unverbindlich und dienen lediglich zu
Informationszwecken. Produkte knnen lnderspezifische Unterschiede aufweisen.
Die in diesem Dokument enthaltenen Informationen sind Eigentum von SAP. Dieses Dokument ist eine Vorabversion und unterliegt nicht Ihrer Lizenzvereinbarung oder einer anderen
Vereinbarung mit SAP. Dieses Dokument enthlt nur vorgesehene Strategien, Entwicklungen und Funktionen des SAP-Produkts und ist fr SAP nicht bindend, einen bestimmten
Geschftsweg, eine Produktstrategie bzw. -entwicklung einzuschlagen. SAP bernimmt keine Verantwortung fr Fehler oder Auslassungen in diesen Materialien. SAP garantiert nicht die
Richtigkeit oder Vollstndigkeit der Informationen, Texte, Grafiken, Links oder anderer in diesen Materialien enthaltenen Elemente. Diese Publikation wird ohne jegliche Gewhr, weder
ausdrcklich noch stillschweigend, bereitgestellt. Dies gilt u. a., aber nicht ausschlielich, hinsichtlich der Gewhrleistung der Marktgngigkeit und der Eignung fr einen bestimmten Zweck
sowie fr die Gewhrleistung der Nichtverletzung geltenden Rechts.
SAP bernimmt keine Haftung fr Schden jeglicher Art, einschlielich und ohne Einschrnkung fr direkte, spezielle, indirekte oder Folgeschden im Zusammenhang mit der Verwendung
dieser Unterlagen. Diese Einschrnkung gilt nicht bei Vorsatz oder grober Fahrlssigkeit.
Die gesetzliche Haftung bei Personenschden oder die Produkthaftung bleibt unberhrt. Die Informationen, auf die Sie mglicherweise ber die in diesem Material enthaltenen Hotlinks
zugreifen, unterliegen nicht dem Einfluss von SAP, und SAP untersttzt nicht die Nutzung von Internetseiten Dritter durch Sie und gibt keinerlei Gewhrleistungen oder Zusagen ber
Internetseiten Dritter ab.
Alle Rechte vorbehalten.