sap 에서 BAPIPRICESCONDITIONS 함수를 사용하여 price condition 을 생성하려고 한다. vendor, material no,…
- User
sap 에서 BAPI_PRICES_CONDITIONS 함수를 사용하여 price condition 을 생성하려고 한다. vendor, material no, valid from , valid to , per , purchase price 의 값을 입력하여 가격조건을 만드는 예제 코드를 생성해줘
Assistant
SAP ABAP에서 BAPI_PRICES_CONDITIONS를 사용하여 구매 가격 조건을 생성하는 예제 코드를 작성해드리겠습니다:
DATA: ls_headerdata TYPE bapicondh, ls_conditiondata TYPE bapicondit, ls_return TYPE bapiret2, lt_return TYPE TABLE OF bapiret2. * Header data 설정 ls_headerdata-cond_type = 'PB00'. "Price condition type for purchasing ls_headerdata-valid_f = '20250101'. "Valid from date ls_headerdata-valid_t = '20251231'. "Valid to date ls_headerdata-vendor_no = '0000100000'. "Vendor number * Condition data 설정 ls_conditiondata-material = '000000000010000000'. "Material number ls_conditiondata-cond_p_unt = '1000'. "Per unit (예: 1000개 단위) ls_conditiondata-cond_value = '100.50'. "Purchase price ls_conditiondata-currency = 'USD'. "Currency * BAPI 실행 CALL FUNCTION 'BAPI_PRICES_CONDITIONS' EXPORTING headerdata = ls_headerdata conditiondata = ls_conditiondata TABLES return = lt_return. * 결과 확인 READ TABLE lt_return INTO ls_return WITH KEY type = 'E'. IF sy-subrc = 0. MESSAGE ls_return-message TYPE 'E'. ELSE. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING wait = 'X'. MESSAGE 'Price condition created successfully' TYPE 'S'. ENDIF.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.