10-09-2008 3:14 PM
Hi Gurus,
I want to include screen control while creating a Sales Order through recording.
Basically my requirement is that I have to create a Sales Order through an Idoc which I can achieve by BDC recording, but I want to include a check stating that on the Sales Order, only 10 Line items can be fit on a page, and then I would like to include the 'page down' functionality.
So if I have more than 10 line items, they should display the first ten line items on the first page, and then so on.
Kindly help.
Thanks.
10-09-2008 3:52 PM
Hi,
Can you use the BAPI BAPI_SALESORDER_CREATEFROMDAT2 instead of BDC?
THanks
Naren
10-09-2008 4:26 PM
10-09-2008 5:19 PM
Hi
In trx VA01 there's the pushputton to place a position at the top, so after inserting a postion u should simulate the action to place the position in order to place the inserted position at the top and place the new position in the second line of table control:
- A) First item: insert it in the first line of table control;
- B) Second item: insert it in the second line of table control;
- B-1)Second Item: place it in the first line of table control;
- C) Third item: insert it in the second line of table control;
- C-1)Third item: place it at the top of table control;
- D)Fourth item: insert it in the second line of table control;
....and so.....
In this way after inserting a new line you move it to the top of table control and so u use only the first two line of table control.
Anyway just as some guys said you you should use the BAPI or std IDOC.
Max
10-09-2008 5:54 PM
Mayank,
One of the approach to fix the default size of the screen is by setting parameters using structure CTU_PARAMS
CTU_PARAMS-DEFSIZE = 'X'.
DISMODE
UPDMODE
CATTMODE
DEFSIZE
RACOMMIT
NOBINPT
NOBIEND
Set these parameters in the recording.
10-09-2008 7:47 PM
Hi,
I suggest you please use BAPI, since you want to use for IDoc.
If you would like to stick to BDC please see the below code. OK code = POAN at end of each line item, Which enables move first line up and second line to fist line. So that you can enter as many line items you want.
perform bdcdata using: 'X' 'SAPMV45A' '4001',
' ' 'BDC_OKCODE' '=POAN'.
***
perform bdcdata using: 'X' 'SAPMV45A' '0101',
' ' 'VBAK-AUART' p_auart,
' ' 'VBAK-VKORG' p_vkorg,
' ' 'VBAK-VTWEG' p_vtweg,
' ' 'VBAK-SPART' p_spart,
' ' 'VBAK-VKBUR' p_vkbur,
' ' 'VBAK-VKGRP' p_vkgrp,
' ' 'BDC_OKCODE' '/00'.
*_ Screen 2
perform bdcdata using: 'X' 'SAPMV45A' '4001',
' ' 'KUAGV-KUNNR' p_kunnr,
' ' 'VBKD-BSARK' p_bsark.
PERFORM bdcdata USING: ' ' 'Z_CSR' 'E010145309'.
if not p_kunag is initial.
perform bdcdata using: 'X' 'SAPMV45A' '4001',
' ' 'KUWEV-KUNNR' p_kunag.
endif.
ws-posnr = 10.
loop at iupload into upload_wa.
ws-index = sy-tabix.
perform bdcdata using: 'X' 'SAPMV45A' '4001'.
if upload_wa-reqdt <> space.
WRITE upload_wa-reqdt TO ws-date.
ws-date = upload_wa-reqdt.
else.
write sy-datum to ws-date.
endif.
perform bdcdata using: ' ' 'RV45A-KETDAT' ws-date.
perform bdcdata using:
' ' 'ZSDSTRUCT_ZGEN_CATID(02)' upload_wa-catlg,
' ' 'ZSDSTRUCT_ZGEN_GRDID(02)' upload_wa-grade,
' ' 'RV45A-KWMENG(02)' upload_wa-zmeng,
' ' 'BDC_OKCODE' '/00'.
if ws-index = '01'.
perform bdcdata using: 'X' 'SAPMV45A' '4001',
' ' 'RV45A-VBAP_SELKZ(01)' 'X',
' ' 'BDC_OKCODE' '=PBES'.
else.
perform bdcdata using: 'X' 'SAPMV45A' '4001',
' ' 'RV45A-VBAP_SELKZ(02)' 'X',
' ' 'BDC_OKCODE' '=PBES'.
endif.
perform bdcdata using: 'X' 'SAPMV45A' '4003',
' ' 'VBAP-POSEX' upload_wa-posnr.
if not upload_wa-kdmat is initial.
perform bdcdata using: ' ' 'VBAP-KDMAT' upload_wa-kdmat.
endif.
perform bdcdata using: ' ' 'BDC_OKCODE' '/EBACK'.
perform bdcdata using: 'X' 'SAPMV45A' '4001',
' ' 'BDC_OKCODE' '=POAN'.
endloop.
perform bdcdata using: 'X' 'SAPMV45A' '4001',
' ' 'BDC_OKCODE' '=POPO'.
perform bdcdata using: 'X' 'SAPMV45A' '0251',
' ' 'RV45A-POSNR' '10',
' ' 'BDC_OKCODE' '=POSI'.
if p_check = 'X'.
perform bdcdata using: 'X' 'SAPMV45A' '4001',
' ' 'BDC_OKCODE' '/EBAC1'.
endif.
Best Regards,