‎2009 Feb 17 5:40 AM
when you generate a program from 'SHDB' ,how to use it ?
thx.
‎2009 Feb 17 5:48 AM
‎2009 Feb 17 5:41 AM
Hi,
Goto SHDB -> goto NEW RECORDING on the TOP -> create recoding name and give Transtion code wich u want to record and then click on start recording.
I have a code which i recored.
"----
Internal table to hold screen information *
"----
DATA :
t_bdcdata LIKE
STANDARD TABLE
OF bdcdata.
*"Data declarations....................................................
"----
Work variables *
"----
DATA:
wa_bdcdata LIKE LINE OF t_bdcdata. " Work Area For t_bdcdata
"----
Selection-Screen Definition *
"----
PARAMETERS :
p_tabnam(50) TYPE c, " Table Name
p_tabdes(125) TYPE c. " Table Description
"----
START-OF-SELECTION *
"----
START-OF-SELECTION.
"----
Initial Screen Of SE11 *
"----
PERFORM bdc_dynpro USING 'SAPMSRD0' '102' 'X'.
PERFORM bdc_dynfield USING 'RSRD1-TBMA' 'X' .
PERFORM bdc_dynfield USING 'RSRD1-TBMA_VAL' p_tabnam .
PERFORM bdc_dynfield USING 'BDC_OKCODE' 'ADD' .
"----
Second Screen Of SE11 *
----
PERFORM bdc_dynpro USING 'SAPLSD41' '2200' 'X'.
PERFORM bdc_dynfield USING 'DD02D-DDTEXT' p_tabdes.
PERFORM bdc_dynfield USING 'DD02D-CONTFLAG' 'A'.
PERFORM bdc_dynfield USING 'DD02D-MAINFLAG' 'X'.
"----
Jumping To Field Tab and filling the fields *
"----
PERFORM bdc_dynfield USING 'BDC_OKCODE' 'DEF'.
PERFORM bdc_dynpro USING 'SAPLSD41' '2200' 'X'.
PERFORM bdc_dynfield USING 'DD03P-FIELDNAME(01)' 'MANDT'.
PERFORM bdc_dynfield USING 'DD03P-FIELDNAME(02)' 'EMPCODE'.
PERFORM bdc_dynfield USING 'DD03P-FIELDNAME(03)' 'EMPNUMBER'.
PERFORM bdc_dynfield USING 'DD03P-KEYFLAG(01)' 'X'.
PERFORM bdc_dynfield USING 'DD03P-KEYFLAG(02)' 'X'.
PERFORM bdc_dynfield USING 'BDC_OKCODE' 'FTYP'.
PERFORM bdc_dynpro USING 'SAPLSD41' '2200' 'X'.
PERFORM bdc_dynfield USING 'DD03D-DATATYPE(01)' 'CLNT'.
PERFORM bdc_dynfield USING 'DD03D-DATATYPE(02)' 'CHAR'.
PERFORM bdc_dynfield USING 'DD03D-DATATYPE(03)' 'CHAR'.
PERFORM bdc_dynfield USING 'DD03P-LENG(01)' '3'.
PERFORM bdc_dynfield USING 'DD03P-LENG(02)' '6'.
PERFORM bdc_dynfield USING 'DD03P-LENG(03)' '25'.
PERFORM bdc_dynfield USING 'DD03P-DDTEXT(01)' 'Client Number'.
PERFORM bdc_dynfield USING 'DD03P-DDTEXT(02)' 'Employee Code'.
PERFORM bdc_dynfield USING 'DD03P-DDTEXT(03)' 'Employee Name'.
PERFORM bdc_dynfield USING 'BDC_OKCODE' 'WB_SAVE'.
PERFORM bdc_dynpro USING 'SAPLSTRD' '0100' 'X'.
PERFORM bdc_dynfield USING 'KO007-L_DEVCLASS' '$TMP'.
PERFORM bdc_dynfield USING 'BDC_OKCODE' 'TEMP'.
PERFORM bdc_dynpro USING 'SAPLSD41' '2200' 'X'.
PERFORM bdc_dynfield USING 'BDC_OKCODE' 'WB_BACK'.
PERFORM bdc_dynpro USING 'SAPMSRD0' '102' 'X'.
PERFORM bdc_dynfield USING 'BDC_OKCODE' 'BACK'.
"----
Call Transaction SE11 *
"----
CALL TRANSACTION 'SE11' USING t_bdcdata MODE 'N'..
"----
Technichal Settings *
"----
REFRESH t_bdcdata[].
CLEAR wa_bdcdata.
PERFORM bdc_dynpro USING 'SAPMSEDS' '10' 'X'.
PERFORM bdc_dynfield USING 'DD09V-TABNAME' p_tabnam.
PERFORM bdc_dynfield USING 'BDC_OKCODE' 'PFLG'.
PERFORM bdc_dynpro USING 'SAPMSEDS' '50' 'X'.
PERFORM bdc_dynfield USING 'DD09V-TABART' 'APPL0'.
PERFORM bdc_dynfield USING 'DD09V-TABKAT' '0'.
PERFORM bdc_dynfield USING 'BDC_OKCODE' 'SICH'.
PERFORM bdc_dynpro USING 'SAPMSEDS' '50' 'X'.
PERFORM bdc_dynfield USING 'BDC_OKCODE' 'BACK'.
PERFORM bdc_dynpro USING 'SAPMSEDS' '10' 'X'.
PERFORM bdc_dynfield USING 'BDC_OKCODE' 'BACK'.
"----
Call Transaction SE13 *
"----
CALL TRANSACTION 'SE13' USING t_bdcdata MODE 'N'.
"----
Activating The Table *
"----
REFRESH t_bdcdata[].
CLEAR wa_bdcdata.
PERFORM bdc_dynpro USING 'SAPMSRD0' '102' 'X'.
PERFORM bdc_dynfield USING 'RSRD1-TBMA' 'X' .
PERFORM bdc_dynfield USING 'RSRD1-TBMA_VAL' p_tabnam .
PERFORM bdc_dynfield USING 'BDC_OKCODE' '=ACT'.
PERFORM bdc_dynpro USING 'SAPLSEWORKINGAREA' '0205' 'X'.
PERFORM bdc_dynfield USING 'BDC_OKCODE' 'WEIT' .
PERFORM bdc_dynpro USING 'SAPMSRD0' '102' 'X'.
PERFORM bdc_dynfield USING 'BDC_OKCODE' 'BACK' .
"----
Call Transaction SE11 *
"----
CALL TRANSACTION 'SE11' USING t_bdcdata MODE 'N'.
&----
*& Form bdc_dynpro
&----
This subroutine assigns the screen information to the bdcdata table
----
This subroutien has parameter interface and user has to pass three *
formal parameters program name , screen number and new screen *
values.
----
FORM bdc_dynpro USING p_prgnam
p_scrno
p_begin.
CLEAR wa_bdcdata.
wa_bdcdata-program = p_prgnam .
wa_bdcdata-dynpro = p_scrno.
wa_bdcdata-dynbegin = p_begin.
APPEND wa_bdcdata TO t_bdcdata.
ENDFORM. " Form bdc_dynpro
&----
*& Form bdc_dynfield
&----
This subroutine assigns the field and field values to the bdcdata *
table . *
----
This subrotuine has parameter interface where user has to pass two *
formal parameters field name and field value. *
----
FORM bdc_dynfield USING p_fnam
p_fval.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = p_fnam .
wa_bdcdata-fval = p_fval .
APPEND wa_bdcdata TO t_bdcdata.
ENDFORM. " Form bdc_dynfield
Thanks,
Neelima.
‎2009 Feb 17 5:42 AM
hi,
After performing the BDC Recording in SHDB, save the recordings.
BACK, click on the new program tab, asks for an option whether to copy from the recording Read from file, click the radio button for Transfer from recording.
Give the program name and click on source code
check out the sample code for your requiremenet. RECORDING FOR XD01
screen_data = bdc_dynpro.
field_data = bdc_field.
LOOP AT t_cust INTO fs_cust.
w_num = w_num + 1.
ON CHANGE OF FS_CUST-NAME1.
PERFORM screen_data USING 'SAPMF02D' '0100'.
PERFORM field_data USING 'BDC_OKCODE' '/00'.
PERFORM field_data USING 'RF02D-BUKRS' fs_cust-bukrs.
PERFORM field_data USING 'RF02D-KTOKD' fs_cust-ktokd.
PERFORM field_data USING 'RF02D-REF_KUNNR' ''.
PERFORM screen_data USING 'SAPMF02D' '0110'.
PERFORM field_data USING 'KNA1-ANRED' fs_cust-anred.
PERFORM field_data USING 'KNA1-NAME1' fs_cust-name1.
PERFORM field_data USING 'KNA1-SORTL' fs_cust-sortl.
PERFORM field_data USING 'KNA1-ORT01' fs_cust-ort01.
PERFORM field_data USING 'KNA1-ORT02' fs_cust-ort02.
PERFORM field_data USING 'KNA1-PFACH' fs_cust-pfach.
PERFORM field_data USING 'KNA1-PSTLZ' fs_cust-pstlz.
PERFORM field_data USING 'KNA1-PFORT' fs_cust-pfort.
PERFORM field_data USING 'KNA1-LAND1' fs_cust-land1.
PERFORM field_data USING 'KNA1-SPRAS' fs_cust-spras.
PERFORM field_data USING 'BDC_OKCODE' '/00'.
PERFORM screen_data USING 'SAPMF02D' '0120'.
PERFORM field_data USING 'BDC_OKCODE' '/00'.
PERFORM screen_data USING 'SAPMF02D' '0125'.
PERFORM field_data USING 'BDC_OKCODE' '/00'.
PERFORM screen_data USING 'SAPMF02D' '0130'.
PERFORM field_data USING 'BDC_OKCODE' '=ENTR'.
PERFORM screen_data USING 'SAPMF02D' '0340'.
PERFORM field_data USING 'BDC_OKCODE' '=ENTR'.
PERFORM screen_data USING 'SAPMF02D' '0370'.
PERFORM field_data USING 'KNA1-CIVVE' 'X'.
PERFORM field_data USING 'BDC_OKCODE' '=ENTR'.
ENDON.
PERFORM screen_data USING 'SAPMF02D' '0360'.
CONCATENATE 'KNVK-ANRED(' w_num ')' INTO line.
PERFORM field_data USING line fs_cust-title. "KNVK-ANRED(01)
CLEAR line.
CONCATENATE 'KNVK-NAMEV(' w_num ')' INTO line.
PERFORM field_data USING line fs_cust-namev. "KNVK-NAMEV(01)
CLEAR line.
CONCATENATE 'KNVK-NAME1(' w_num ')' INTO line.
PERFORM field_data USING line fs_cust-name2. "KNVK-NAME1(01)
CLEAR line.
CONCATENATE 'KNVK-TELF1(' w_num ')' INTO line.
PERFORM field_data USING line fs_cust-telf1. "KNVK-TELF1(01)
CLEAR line.
CONCATENATE 'KNVK-TELF1(' w_num ')' INTO line.
PERFORM field_data USING line fs_cust-abtnr. "KNVK-ABTNR(01)
PERFORM field_data USING 'BDC_OKCODE' '=ENTR'.
AT END OF NAME1.
PERFORM screen_data USING 'SAPMF02D' '0360'.
PERFORM field_data USING 'BDC_OKCODE' '=ENTR'.
PERFORM screen_data USING 'SAPMF02D' '0210'.
PERFORM field_data USING 'KNB1-AKONT' fs_cust-akont.
PERFORM field_data USING 'BDC_OKCODE' '/00'.
PERFORM screen_data USING 'SAPMF02D' '0215'.
PERFORM field_data USING 'BDC_OKCODE' '/00'.
PERFORM screen_data USING 'SAPMF02D' '0220'.
PERFORM field_data USING 'BDC_OKCODE' '/00'.
PERFORM screen_data USING 'SAPMF02D' '0230'.
PERFORM field_data USING 'BDC_OKCODE' '/00'.
CALL TRANSACTION 'XD01' USING t_steps MODE 'A' MESSAGES INTO t_messages.
REFRESH T_STEPS.
clear w_num.
ENDAT.
ENDLOOP. " LOOP AT t_cust INTO fs_cust
*----------------------------------------------------------------------*
* Form screen_data *
*----------------------------------------------------------------------*
* This sub-routine assigns the program name and screen number to the *
* internal table *
*----------------------------------------------------------------------*
* The screen number and the program name are the interface parameters *
* passed to this subroutine *
*----------------------------------------------------------------------*
FORM screen_data USING value(p_program_name)
value(p_screen_number).
CLEAR t_steps.
t_steps-program = p_program_name.
t_steps-dynpro = p_screen_number.
t_steps-dynbegin = 'X'.
APPEND t_steps.
ENDFORM. " SCREEN_DATA
*----------------------------------------------------------------------*
* Form field_data *
*----------------------------------------------------------------------*
* This sub-routine passed the field name and corresponding field value*
* to the internal table t_steps *
*----------------------------------------------------------------------*
* The field name and the field value are the interface parameters *
* passed to this sub-routine *
*----------------------------------------------------------------------*
FORM field_data USING value(p_fieldname)
value(p_value).
CLEAR t_steps.
t_steps-fnam = p_fieldname.
t_steps-fval = p_value.
APPEND t_steps.
ENDFORM. " FIELD_DATAThanks
Sharath
‎2009 Feb 17 5:43 AM
hi...
in the generated program you have to pass on the parameters approperiatly
and thats all
regards
‎2009 Feb 17 5:44 AM
Hi,
Use SHDB when u have recorded a transaction steps for screen navigation.
If u want the recorded steps in a program ,click on the recorded transaction,select program tab and select transfer from recording and give name of program( new program ) in which u want those recorded steps in terms of perform statements.
‎2009 Feb 17 5:44 AM
Hi,
Do recording through SHDB and call program from that and use CALL TRANSACTION.
like,
CALL TRANSACTION 'SE11' USING t_bdc MODE 'N' MESSAGES INTO t_msg.
Regards,
jaya
‎2009 Feb 17 5:52 AM
CALL TRANSACTION '***'
USING t_bdc
MODE v_mode
UPDATE 'S'
MESSAGES INTO t_bdcmsg.that means the generated program is only used to fille the data of t_bdc ?
‎2009 Feb 17 6:58 AM
Hi,
yes it is.In order not to write all perform statements by hand ,we can get it through that generated program.
‎2009 Feb 17 5:45 AM
Hi Shou,
After you have recorded you can can use it in your report.
this can be done fron the SHDB transaction itsel.
Then you have to create a subroutine of the table bdcdata fields and run your transaction.
Much Regards,
Amuktha.
‎2009 Feb 17 5:48 AM
Hi,
After generating the SHDB just click on the creted recording and then select program and there give a program name -> click on transfer from recording>enter---> then implement u r logic...
once u done wid u r programing part...
goto SHDB select the recording u want and press F8.....if u want background mode seelct the simulate background mode..
Regards
Kiran
‎2009 Feb 17 5:48 AM
‎2009 Feb 17 5:50 AM
Hi,
After completion of the recording, in the same transaction select the recording name and click on Program tab. It creates a report program for the recording. Same program you can change as per the requirement.
Regards,
Rajitha.
‎2009 Feb 17 9:16 AM
Hi,
Check the below Link
http://help.sap.com/saphelp_nw04/helpdata/en/67/42fccff61011d1bcf9080009b4534c/frameset.htm
Regards,
Anki Reddy