Call Function할때, 특히 BAPI같은 경우에는 넘겨주워 하는 파라미터가 참 많기도 하지요, 일일히 선언해 주어야 하는데 이게 여간 귀찮은 작업이 아닙니다.
구글링 하다가 보니 SDN에 function parameter를 자동으로 생성해주는 패턴구문이 있더라구요, 한번 해봤는데 만족스럽습니다.
예를 들어 아래의 변수 선언 부분을 자동으로 만들어 주는 패턴 입니다.
순서는
1. Function group 생성
2. Function module 생성
3. Custom Pattern생성
이렇게 하시면 됩니다.
관련 링크 아래
data v_salesdocumentin like bapivbeln-vbeln.
data v_order_header_in type bapisdhd1.
data v_order_header_inx type bapisdhd1x.
data v_sender type bapi_sender.
data v_binary_relationshiptype like bapireltype-reltype.
data v_int_number_assignment like bapiflag-bapiflag.
data v_behave_when_error like bapiflag-bapiflag.
data v_logic_switch type bapisdls.
data v_testrun like bapiflag-bapiflag.
data v_convert like bapiflag-bapiflag.
data v_salesdocument like bapivbeln-vbeln.
data it_return type standard table of bapiret2.
data it_order_items_in type standard table of bapisditm.
data it_order_items_inx type standard table of bapisditmx.
data it_order_partners type standard table of bapiparnr.
data it_order_schedules_in type standard table of bapischdl.
data it_order_schedules_inx type standard table of bapischdlx.
data it_order_conditions_in type standard table of bapicond.
data it_order_conditions_inx type standard table of bapicondx.
data it_order_cfgs_ref type standard table of bapicucfg.
data it_order_cfgs_inst type standard table of bapicuins.
data it_order_cfgs_part_of type standard table of bapicuprt.
data it_order_cfgs_value type standard table of bapicuval.
data it_order_cfgs_blob type standard table of bapicublb.
data it_order_cfgs_vk type standard table of bapicuvk.
data it_order_cfgs_refinst type standard table of bapicuref.
data it_order_ccard type standard table of bapiccard.
data it_order_text type standard table of bapisdtext.
data it_order_keys type standard table of bapisdkey.
data it_extensionin type standard table of bapiparex.
data it_partneraddresses type standard table of bapiaddr1.
call function 'BAPI_SALESORDER_CREATEFROMDAT2'
exporting
* SALESDOCUMENTIN = v_SALESDOCUMENTIN
order_header_in = v_order_header_in
* ORDER_HEADER_INX = v_ORDER_HEADER_INX
* SENDER = v_SENDER
* BINARY_RELATIONSHIPTYPE = v_BINARY_RELATIONSHIPTYPE
* INT_NUMBER_ASSIGNMENT = v_INT_NUMBER_ASSIGNMENT
* BEHAVE_WHEN_ERROR = v_BEHAVE_WHEN_ERROR
* LOGIC_SWITCH = v_LOGIC_SWITCH
* TESTRUN = v_TESTRUN
* CONVERT = v_CONVERT
* IMPORTING
* SALESDOCUMENT = v_SALESDOCUMENT
tables
* RETURN = it_RETURN
* ORDER_ITEMS_IN = it_ORDER_ITEMS_IN
* ORDER_ITEMS_INX = it_ORDER_ITEMS_INX
order_partners = it_order_partners
* ORDER_SCHEDULES_IN = it_ORDER_SCHEDULES_IN
* ORDER_SCHEDULES_INX = it_ORDER_SCHEDULES_INX
* ORDER_CONDITIONS_IN = it_ORDER_CONDITIONS_IN
* ORDER_CONDITIONS_INX = it_ORDER_CONDITIONS_INX
* ORDER_CFGS_REF = it_ORDER_CFGS_REF
* ORDER_CFGS_INST = it_ORDER_CFGS_INST
* ORDER_CFGS_PART_OF = it_ORDER_CFGS_PART_OF
* ORDER_CFGS_VALUE = it_ORDER_CFGS_VALUE
* ORDER_CFGS_BLOB = it_ORDER_CFGS_BLOB
* ORDER_CFGS_VK = it_ORDER_CFGS_VK
* ORDER_CFGS_REFINST = it_ORDER_CFGS_REFINST
* ORDER_CCARD = it_ORDER_CCARD
* ORDER_TEXT = it_ORDER_TEXT
* ORDER_KEYS = it_ORDER_KEYS
* EXTENSIONIN = it_EXTENSIONIN
* PARTNERADDRESSES = it_PARTNERADDRESSES
.
댓글 7
-
아밥뽀
2014.10.20 18:21
-
토종붕어
2014.10.24 23:13
정말 유용하네요... 감사합니다~
-
Drunken Lion
2014.10.24 23:34
호~ 획기적인데요?!!
추천합니다.
-
피오
2014.10.25 02:55
정말 유용하네요... ㅎㅎ
-
cupycopy2000
2014.10.25 07:30
ABAP release 731 부터는 ABAP editor 기본 기능으로 탑제되었답니다. up version 쓰시는분들 부럽군요..ㅋ
-
아밥뽀
2015.02.15 04:38
아주 유용한 팁이네요 ~~
-
Brisky
2015.02.16 07:39
정말 좋은 팁 감사합니다.
와우 아주 좋은 팁이네요~~
유용하게 활용될것 같습니다. 추천합니다.