‎2006 Dec 05 8:56 PM
Hi,
It seems that FM G_SET_CREATION is not a true function module where I could provide all the parameters wit the values and the sets would be created automatically. Somehow, I have to write a program to do the BDC steps. Has anyone written a program to use FMs G_SET_CREATION and G_SET_MAINTENANCE? How would I use these FMs?
Thanks,
Will
‎2006 Dec 06 3:44 AM
Hi Will,
Please try this.
data: num(2) type n value '01',
fname(132) type c.
...
loop at itab.
clear fname.
concatenate 'RGSBL-FROM(' num ')' into fname.
perform bdc_field using fname itab-field.
num = num + 1.
endloop.
...Regards,
Ferry Lianto
‎2006 Dec 05 9:07 PM
Hi Will,
Please check program RGMSETGEN and SAPMGJSX perhaps they may help.
Regards,
Ferry Lianto
‎2006 Dec 05 9:24 PM
Hi,
I got a runtime error on SAPMGJSX and RGMSETGEN is an include. Would you think it would be possible to create sets in batch or automate TCODE GS01 and GS02?
Thanks,
WIll
‎2006 Dec 06 2:50 AM
Hi Will,
Sorry for late reply.
I think it is possible to create sets in batch or automate tcode GS01/GS02.
Have you tried to record session for GS01/GS02 using transaction SHDB?
Regards,
Ferry Lianto
‎2006 Dec 06 3:04 AM
Hi Ferry,
I am actually working on it right now.
I am having problem though with the entries for the FROM column. Would you happen to have sample code to do this?
I am looping through and this what I have
Loop at...
add 1 to l_item.
PERFORM BDC_FIELD USING 'RGSBL-FROM(l_item)'
ITAB-field.
Endloop.
Would this work? to enter multiple entries to the FROm column and to how many there are thatI have to complete creating the basic set?
Thanks,
Will
‎2006 Dec 06 3:19 AM
Hi Will,
Please check this sample code in for BDC line item loop.
FORM populate_data .
data: lv_po(35) type c,
gv_num(3) type n value '001',
gv_fname1(132) type c,
gv_fname2(132) type c,
gv_fname3(132) type c,
gv_fname4(132) type c.
sort gt_sdata by BSTKD POSNR.
describe table gt_sdata lines l1_num.
loop at gt_sdata INTO gs_sdata.
if lv_po ne gs_sdata-bstkd.
lv_po = gs_sdata-bstkd.
clear: gv_fname1, gv_fname2, gv_fname3, GV_FNAME4.
perform bdc_dynpro using 'SAPMV45A' '0101'.
perform bdc_field using 'BDC_CURSOR' 'VBAK-AUART'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'VBAK-AUART' 'OR'.
perform bdc_field using 'VBAK-VKORG' '300'.
perform bdc_field using 'VBAK-VTWEG' '20'.
perform bdc_field using 'VBAK-SPART' '01'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE' '=KKAU'.
perform bdc_field using 'VBKD-BSTKD' gs_sdata-BSTKD.
perform bdc_field using 'VBKD-BSTDK' gs_sdata-BSTDK.
perform bdc_field using 'KUAGV-KUNNR' '1195'.
perform bdc_field using 'KUWEV-KUNNR' gs_sdata-KUNNR1.
perform bdc_field using 'RV45A-KETDAT' GS_SDATA-KETDAT.
perform bdc_field using 'RV45A-KPRGBZ' 'D'.
perform bdc_field using 'RV45A-DWERK' 'INDY'.
if gv_num = gs_sdata-POSNR.
concatenate 'RV45A-KWMENG(' gv_num ')' INTO GV_FNAME1.
concatenate 'VBAP-POSNR(' gv_num ')' INTO GV_FNAME2.
concatenate 'RV45A-MABNR(' gv_num ')' INTO GV_FNAME3.
concatenate 'KOMV-KBETR(' gv_num ')' INTO GV_FNAME4.
perform bdc_field using 'BDC_CURSOR' 'GV_FNAME1'.
perform bdc_field using GV_FNAME1 gs_sdata-POSNR.
perform bdc_field using GV_FNAME2 gs_sdata-MABNR.
perform bdc_field using GV_FNAME3 gs_sdata-KWMENG.
perform bdc_field using GV_FNAME4 gs_sdata-KBETR.
gv_num = gv_num + 1.
* APPEND gs_sdata.
* Clear gs_sdata.
endif.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE' '=SICH'.
perform bdc_field using 'BDC_CURSOR' 'VBAK-GWLDT'.
perform bdc_field using 'VBAK-AUDAT' '08/24/2006'.
perform bdc_field using 'VBAK-VKBUR' '30'.
perform bdc_field using 'VBAK-GWLDT' GS_SDATA-GWLDT.
perform bdc_field using 'VBAK-WAERK' 'USD'.
perform bdc_field using 'VBKD-PRSDT' '08/24/2006'.
perform bdc_field using 'VBKD-KDGRP' '03'.
clear gs_sdata.
continue.
endif.
AT END of BSTKD.
perform bdc_transaction using 'VA01'.
clear gs_sdata.
ENDAT.
endloop.
ENDFORM. " populate_dataHope this will help.
Regards,
Ferry Lianto
‎2006 Dec 06 3:34 AM
Hi Ferry,
Thanks so much for the code. here is the partial code when I did the recording:
perform bdc_field using 'RGSBL-FROM(01)'
record-FROM_01_008.
perform bdc_field using 'RGSBL-FROM(02)'
record-FROM_02_009.
perform bdc_field using 'RGSBL-FROM(03)'
record-FROM_03_010.
perform bdc_field using 'RGSBL-FROM(04)'
record-FROM_04_011.
My problem is the second screen of GS01 has a FROM column that is not unique in the field, so when I did the recording it has FROM(01), (02), etc... so it is each row that I have to somehow enter a variable to take on the numerica value instead of hardocoding it to (01) (02) etc.
I tried my code and I am getting an error
<i>Field RGSBL-FROM not found in loop of screen SAPMGSBM 0115</i>
Hope that makes sense.
Thanks,
Will
Message was edited by:
Will Ferrell
‎2006 Dec 06 3:47 AM
Hi,
Just use a counter variable.
Eg. data c1(2).
data d1(20).
c1 = 0.
loop...
c1 = c1 + 1.
unpack c1 to c1.
concatenate 'RGSBL-FROM(' c1 ')' to d1.
perform bdc_field using d1 record-from_01_008.
endloop.
‎2006 Dec 06 3:56 AM
Hi Ferry
Thanks so much and regards... I see it now.
Thanks Jayanthi .
‎2006 Dec 06 4:53 AM
Hi Ferry,
The code worked so well until I was creating a set that has more then 14 rows. The screen can only accept up to 14 rows until then I got an error. I did the recording and I tried the BDC OK_CODE P+ and P++; it did not work. I eventried to use the scroll feature on the right hand side but RGSBL-FROM(14) stays at 14 and did not increment to 15, 16, 17 etc..
Any ideas how I would handle the screen for any sets that is more than 14?
Thanks,
Will
‎2006 Dec 06 3:36 AM
‎2006 Dec 06 3:41 AM
Hi
How ouwlI reference the first row, second row, third row etc for the FROM column when looping through this screen that I have an error?
Thanks,
Will
Message was edited by:
Will Ferrell
‎2006 Dec 06 3:44 AM
Hi Will,
Please try this.
data: num(2) type n value '01',
fname(132) type c.
...
loop at itab.
clear fname.
concatenate 'RGSBL-FROM(' num ')' into fname.
perform bdc_field using fname itab-field.
num = num + 1.
endloop.
...Regards,
Ferry Lianto