안녕하세요 질문할께 하나 있어서 이렇게 글을 올려봅니다.
다름이 아니라 BDC 테워서 FBV1 임시전표 생성하려하는데 PAGE DOWN이부분에서 '=P+'이렇게 코딩을 해주는걸로
알고 해줬는데..이부분에서만 계속 멈춰서 다음부분을 안타네요.. 아바퍼님들 좀 도와주세요 ㅜ.ㅜ
PERFORM bdc_dynpro USING 'SAPLF040' '0100' 'X'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RF05V-NEWKO'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'BKPF-BLDAT' gv_endda. "Document Date
PERFORM bdc_field USING 'BKPF-BLART' 'IC'. "Document Type
PERFORM bdc_field USING 'BKPF-BUKRS' p_gt_monthly-bukrs_b. "Company Code
PERFORM bdc_field USING 'BKPF-BUDAT' gv_endda. "Posting Date
PERFORM bdc_field USING 'BKPF-MONAT' p_gt_monthly-yearmon+4(2). "Period
PERFORM bdc_field USING 'BKPF-WAERS' p_gt_monthly-currency_b. "Currency
PERFORM bdc_field USING 'VBKPF-XBWAE' 'X'.
PERFORM bdc_field USING 'FS006-DOCID' '*'.
PERFORM bdc_field USING 'RF05V-NEWBS' p_gt_monthly-b_bschl_d. "Posting Key 차변"
PERFORM bdc_field USING 'RF05V-NEWKO' p_gt_monthly-b_saknr_d. "40 일 땐 계정이 들어감
PERFORM bdc_dynpro USING 'SAPLF040' '0300' 'X'.
PERFORM bdc_field USING 'BDC_CURSOR' 'BSEG-WRBTR'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
* 해당통화에 맞는 금액으로 변경
IF p_gt_monthly-s_bschl_d = '01'.
*{ billing company인 경우 환율 곱해줌
p_gt_monthly-icsales = p_gt_monthly-icsales * p_gt_monthly-rate1.
*}
CALL FUNCTION 'CURRENCY_AMOUNT_SAP_TO_IDOC'
EXPORTING
currency = p_gt_monthly-currency_b
sap_amount = p_gt_monthly-icsales
IMPORTING
idoc_amount = p_gt_monthly-conicsales1.
ELSE.
*{ billing company인 경우 환율 곱해줌
* p_gt_monthly-iccos = p_gt_monthly-iccos * p_gt_monthly-rate1.
*}
CALL FUNCTION 'CURRENCY_AMOUNT_SAP_TO_IDOC'
EXPORTING
currency = p_gt_monthly-currency_b
sap_amount = p_gt_monthly-conicsales "환율이 곱해진 값
IMPORTING
idoc_amount = p_gt_monthly-conicsales1.
ENDIF.
CONDENSE p_gt_monthly-conicsales1.
CHECK p_gt_monthly-conicsales1 <> '0'.
PERFORM bdc_field USING 'BSEG-WRBTR' p_gt_monthly-conicsales1. "금액
PERFORM bdc_field USING 'BSEG-MWSKZ' p_gt_monthly-taxcode_b. "세금코드
PERFORM bdc_field USING 'BSEG-VALUT' gv_endda.
PERFORM bdc_dynpro USING 'SAPLKACB' '0002' 'X'.
PERFORM bdc_field USING 'BDC_CURSOR' 'COBL-KOSTL'.
PERFORM bdc_field USING 'BDC_OKCODE' '=ENTE'.
PERFORM bdc_field USING 'COBL-GSBER' p_gt_monthly-bukrs_b. "Business Area.
PERFORM bdc_field USING 'COBL-KOSTL' p_gt_monthly-b_kostl_d. "Kostl
PERFORM bdc_dynpro USING 'SAPLF040' '0300' 'X'.
PERFORM bdc_field USING 'BDC_CURSOR' 'BSEG-WRBTR'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'BSEG-WRBTR' p_gt_monthly-conicsales1. "금액
PERFORM bdc_field USING 'BSEG-MWSKZ' p_gt_monthly-taxcode_b. "세금코드
PERFORM bdc_field USING 'BSEG-VALUT' gv_endda.
PERFORM bdc_field USING 'DKACB-FMORE' 'X'.
PERFORM bdc_dynpro USING 'SAPLKACB' '0002' 'X'.
PERFORM bdc_field USING 'BDC_CURSOR' 'COBL-GSBER'.
PERFORM bdc_field USING 'BDC_OKCODE' '=COBL_XERGO'.
PERFORM bdc_field USING 'COBL-GSBER' p_gt_monthly-bukrs_b. "Business Area.
PERFORM bdc_field USING 'COBL-KOSTL' p_gt_monthly-b_kostl_d. "Kostl
PERFORM bdc_dynpro USING 'SAPLKEAK' '0300' 'X'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RKEAK-FIELD(05)'.
PERFORM bdc_field USING 'BDC_OKCODE' '=WEIT'.
IF p_gt_monthly-b_cont_d IS NOT INITIAL. "Contract 가 선택된 경우
PERFORM bdc_field USING 'RKEAK-FIELD(02)' p_gt_monthly-matnr.
IF p_gt_monthly-vbeln <= '0040000000'. "Contract 가 선택된 경우
PERFORM bdc_field USING 'RKEAK-FIELD(04)' p_gt_monthly-vbeln.
PERFORM bdc_field USING 'RKEAK-FIELD(05)' p_gt_monthly-posnr.
ELSE.
PERFORM bdc_dynpro USING 'SAPLKEAK' '0300' 'X'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RKEAK-FIELD(08)'.
PERFORM bdc_field USING 'BDC_OKCODE' '=P+'. <----이부분 입니다.
PERFORM bdc_dynpro USING 'SAPLKEAK' '0300' 'X'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RKEAK-FIELD(12)'.
PERFORM bdc_field USING 'BDC_OKCODE' '=WEIT'.
PERFORM bdc_field USING 'RKEAK-FIELD(12)' p_gt_monthly-vbeln.
ENDIF.
ENDIF.
PERFORM bdc_field USING 'RKEAK-FIELD(08)' p_gt_monthly-bukrs_b.
PERFORM bdc_dynpro USING 'SAPLKACB' '0002' 'X'.
PERFORM bdc_field USING 'BDC_CURSOR' 'COBL-GSBER'.
PERFORM bdc_field USING 'BDC_OKCODE' '=ENTE'.
PERFORM bdc_field USING 'COBL-GSBER' p_gt_monthly-bukrs_b.
PERFORM bdc_field USING 'COBL-KOSTL' p_gt_monthly-b_kostl_d.
PERFORM bdc_dynpro USING 'SAPLF040' '0300' 'X'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RF05V-NEWKO'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'BSEG-WRBTR' p_gt_monthly-conicsales1.
PERFORM bdc_field USING 'BSEG-VALUT' gv_endda.
PERFORM bdc_field USING 'RF05V-NEWBS' p_gt_monthly-b_bschl_c. "Posting Key 대변
PERFORM bdc_field USING 'RF05V-NEWKO' p_gt_monthly-b_vendor_c. "Vendor
PERFORM bdc_field USING 'DKACB-FMORE' 'X'.
PERFORM bdc_dynpro USING 'SAPLKACB' '0002' 'X'.
PERFORM bdc_field USING 'BDC_CURSOR' 'COBL-GSBER'.
PERFORM bdc_field USING 'BDC_OKCODE' '=ENTE'.
PERFORM bdc_field USING 'COBL-GSBER' p_gt_monthly-bukrs_b.
PERFORM bdc_field USING 'COBL-KOSTL' p_gt_monthly-b_kostl_d. "Kostl_sales_credit
PERFORM bdc_dynpro USING 'SAPLF040' '0302' 'X'.
PERFORM bdc_field USING 'BDC_CURSOR' 'BSEG-GSBER'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'BSEG-HKONT' p_gt_monthly-b_saknr_c. "Kostl_sales_credit
PERFORM bdc_field USING 'BSEG-WRBTR' p_gt_monthly-conicsales1.
* PERFORM bdc_field USING 'BSEG-MWSKZ' '**'.
PERFORM bdc_field USING 'BSEG-GSBER' p_gt_monthly-bukrs_b.
PERFORM bdc_dynpro USING 'SAPLF040' '0302' 'X'.
PERFORM bdc_field USING 'BDC_CURSOR' 'BSEG-WRBTR'.
PERFORM bdc_field USING 'BDC_OKCODE' '=BP'.
PERFORM bdc_field USING 'BSEG-HKONT' p_gt_monthly-b_saknr_c. "Kostl_sales_credit
PERFORM bdc_field USING 'BSEG-WRBTR' p_gt_monthly-conicsales1.
* PERFORM bdc_field USING 'BSEG-MWSKZ' '**'.
PERFORM bdc_field USING 'BSEG-GSBER' p_gt_monthly-bukrs_b.
^^
http://www.e-abap.net/zb/bbs/zboard.php?id=abapqna&page=1&sn1=&divpage=1&sn=off&ss=on&sc=on&keyword=FBV1&select_arrange=headnum&desc=asc&no=5151
참고해 보세요..