‎2006 Sep 04 12:39 PM
start-of-selection. perform open_group. loop at itab. at new pname. line = '01'. endat. if itab-level = '1'. line = '01'. wbs = itab-wbs. endif. perform bdc_dynpro using 'SAPMKBUD' '0200'. perform bdc_field using 'BDC_CURSOR' 'BPDY-TWAER'. perform bdc_field using 'BDC_OKCODE' '/00'. perform bdc_field using 'PROJ-PSPID' itab-pname. perform bdc_field using 'PRPS-POSID' wbs. perform bdc_field using 'BPDY-TWAER' 'pkr'. perform bdc_dynpro using 'SAPLKBPP' '0320'. perform bdc_field using 'BDC_CURSOR' 'BPDY-WERT1(02)'. perform bdc_field using 'BDC_OKCODE' '/00'. cursor = 'BPDY-WERT1'. concatenate cursor '(' line ')' into cursor. perform bdc_field using cursor itab-over_all_budget. perform bdc_dynpro using 'SAPLKBPP' '0320'. perform bdc_field using 'BDC_CURSOR' 'DROPT-PTIME'. perform bdc_field using 'BDC_OKCODE' '=DROT'. perform bdc_field using 'DROPT-PTIME' itab-year. perform bdc_dynpro using 'SAPLKBPP' '0320'. perform bdc_field using 'BDC_CURSOR' 'BPDY-WERT1(09)'. perform bdc_field using 'BDC_OKCODE' '/00'. perform bdc_field using 'DROPT-PTIME' itab-year. perform bdc_field using cursor itab-year_budget. perform bdc_dynpro using 'SAPLKBPP' '0320'. perform bdc_field using 'BDC_CURSOR' 'BPDY-WERT1(09)'. perform bdc_field using 'BDC_OKCODE' '=POST'. " perform bdc_transaction using 'CJ32'." line = line + 1. endloop. perform close_group.FORM OPEN_GROUP. IF SESSION = 'X'. SKIP. WRITE: /(20) 'Create group'(I01), GROUP. SKIP.* open batchinput group CALL FUNCTION 'BDC_OPEN_GROUP' EXPORTING CLIENT = SY-MANDT GROUP = GROUP USER = USER KEEP = KEEP HOLDDATE = HOLDDATE. WRITE: /(30) 'BDC_OPEN_GROUP'(I02), (12) 'returncode:'(I05), SY-SUBRC. ENDIF.ENDFORM.
‎2006 Sep 04 12:46 PM
hi,
1) try to format your coding with button "Code"
2) prg is a bdc to transaction CJ32
3) start prg. and turn to trx SM35
A.
Message was edited by: Andreas Mann
‎2006 Sep 04 12:58 PM
‎2006 Sep 04 1:59 PM
hi
good
start-of-selection.
perform open_group.
loop at itab.
at new pname. line = '01'.
endat.
if itab-level = '1'.
line = '01'.
wbs = itab-wbs.
endif.
perform bdc_dynpro using 'SAPMKBUD' '0200'.
perform bdc_field using 'BDC_CURSOR' 'BPDY-TWAER'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'PROJ-PSPID' itab-pname.
perform bdc_field using 'PRPS-POSID' wbs.
perform bdc_field using 'BPDY-TWAER' 'pkr'.
perform bdc_dynpro using 'SAPLKBPP' '0320'.
perform bdc_field using 'BDC_CURSOR' 'BPDY-WERT1(02)'.
perform bdc_field using 'BDC_OKCODE' '/00'. cursor = 'BPDY-WERT1'.
concatenate cursor '(' line ')' into cursor.
perform bdc_field using cursor itab-over_all_budget.
perform bdc_dynpro using 'SAPLKBPP' '0320'.
perform bdc_field using 'BDC_CURSOR' 'DROPT-PTIME'.
perform bdc_field using 'BDC_OKCODE' '=DROT'.
perform bdc_field using 'DROPT-PTIME' itab-year.
perform bdc_dynpro using 'SAPLKBPP' '0320'.
perform bdc_field using 'BDC_CURSOR' 'BPDY-WERT1(09)'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'DROPT-PTIME' itab-year.
perform bdc_field using cursor itab-year_budget.
perform bdc_dynpro using 'SAPLKBPP' '0320'.
perform bdc_field using 'BDC_CURSOR' 'BPDY-WERT1(09)'.
perform bdc_field using 'BDC_OKCODE' '=POST'. "
perform bdc_transaction using 'CJ32'." line = line + 1.
endloop. perform close_group.FORM OPEN_GROUP.
IF SESSION = 'X'. SKIP. WRITE: /(20) 'Create group'(I01), GROUP. SKIP.*
open batchinput group
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING CLIENT = SY-MANDT
GROUP = GROUP
USER = USER
KEEP = KEEP
HOLDDATE = HOLDDATE.
WRITE: /(30) 'BDC_OPEN_GROUP'(I02), (12) 'returncode:'(I05), SY-SUBRC.
ENDIF.
ENDFORM.
this is the over all program but this is contain only persoem statement, so it would be tough to give you detail explanation for this.
the code is CJ32 for which this recording is done.
this is a bdc session process.
thanks
mrutyun^
‎2006 Sep 05 5:44 AM