Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BDC transaction

Former Member
0 Kudos
240

Hi,

I need to insert a paragraph of comments at the first line of my program so I have use BDC to insert it. Before I record it, I have already created it as a new pattern to insert the comments. During the recording, I will have to click on the "pattern" button to insert the paragraph, it could work. But then when I process it again, it will stop at the after i got the "=ed_insert_frame" ok code. I will need to click on the "pattern" button then only it will proceed to the end of my steps. How can I insert a paragraph of comments in other ways?

Thanks and have a nice day.

Shannon Lee

6 REPLIES 6

jayanthi_jayaraman
Active Contributor
0 Kudos
76

Hi,

If your requirement is to write a paragraph at the begining of the program,you can achieve it by using write statement before your output.

Code sample:

write 'This is first line'.

Regards,

J.Jayanthi

0 Kudos
76

Hi,

Thanks for your reply. Sorry that I did not explain clearly. I meant that I need to run this BDC to insert a paragraph in multiple programs but the users select the range of programs at the selection screen, so I cannot insert the paragraph manually. Does anyone have an idea on how to do this using BDC? I need to use BDC to do this as this is the requirement. Thanks.

0 Kudos
76

Hi,

Create a transaction for you program.Then in SHDB transaction try to record your program.Then it will be easy for you to record from your program's selection screen.

For more information about BDC , check these links.

http://www.sap-img.com/abap.htm

http://www.sap-img.com/abap/learning-bdc-programming.htm

http://www.kabai.com/abaps/z76.htm

http://help.sap.com/saphelp_47x200/helpdata/en/fa/097022543b11d1898e0000e8322d00/frameset.htm

0 Kudos
76

Hi,

The links you given are helpful. But I have another problem occurred. While I am doing the recording, the Pattern Button does not work, where the user will need to click by it self. But in my program it does not go to that process and my program is not working. It does not activate the program either. I will need to go back to se38 screen and go inside the program 2nd time then onl it will be activated. How could the pattern button can be captured?

perform bdc_dynpro using 'SAPLWBABAP' '0100'.

perform bdc_field using 'BDC_CURSOR'

'RS38M-PROGRAMM'.

perform bdc_field using 'BDC_OKCODE'

'=CHAP'.

perform bdc_field using 'RS38M-PROGRAMM'

T_TRDIR-NAME.

perform bdc_field using 'RS38M-FUNC_EDIT'

'X'.

perform bdc_dynpro using 'SAPLS38E' '0400'.

perform bdc_field using 'BDC_OKCODE'

'=ED_INS_FRAME'.

perform bdc_field using 'BDC_CURSOR'

'RSTXP-TDLINE(01)'.

perform bdc_field using 'RSTXP-TDFIRST'

' 1'.

perform bdc_dynpro using 'SAPLLOCAL_EDT1' '2520'.

perform bdc_field using 'BDC_CURSOR'

'RSTXP-TDANWEISNG'.

perform bdc_field using 'BDC_OKCODE'

'=PACO'.

perform bdc_field using 'MARK2'

' '.

perform bdc_field using 'MARK13'

'.'.

perform bdc_field using 'MARK3'

'.'.

perform bdc_field using 'RSTXP-TDID'

'00'.

perform bdc_field using 'RSTXP-TDTYP'

'E'.

perform bdc_field using 'MARK1'

'.'.

perform bdc_field using 'MARK8'

'.'.

perform bdc_field using 'MARK7'

'.'.

perform bdc_field using 'MARK11'

'.'.

perform bdc_field using 'MARK12'

'.'.

perform bdc_field using 'MARK5'

'.'.

perform bdc_field using 'MARK9'

'X'.

perform bdc_field using 'MARK10'

'.'.

perform bdc_field using 'MARK6'

'.'.

perform bdc_field using 'MARK4'

'X'.

perform bdc_field using 'RSTXP-TDANWEISNG'

'zcopyright'.

perform bdc_dynpro using 'SAPLS38E' '0400'.

perform bdc_field using 'BDC_OKCODE'

'=WB_SAVE'.

perform bdc_field using 'BDC_CURSOR'

'RSTXP-TDLINE(01)'.

perform bdc_field using 'RSTXP-TDFIRST'

' 1'.

perform CALL_transaction using 'SE38'.

perform bdc_dynpro using 'SAPLWBABAP' '0100'.

perform bdc_field using 'BDC_CURSOR'

'RS38M-PROGRAMM'.

perform bdc_field using 'BDC_OKCODE'

'=CHAP'.

perform bdc_field using 'RS38M-PROGRAMM'

'ZSHANNON_COPY'.

perform bdc_field using 'RS38M-FUNC_EDIT'

'X'.

perform bdc_dynpro using 'SAPLS38E' '0400'.

perform bdc_field using 'BDC_OKCODE'

'=WB_ACTIVATE'.

perform bdc_field using 'BDC_CURSOR'

'RSTXP-TDLINE(01)'.

perform bdc_field using 'RSTXP-TDFIRST'

' 1'.

perform bdc_dynpro using 'SAPLSEWORKINGAREA' '0205'.

perform bdc_field using 'BDC_OKCODE'

'=WEIT'.

perform bdc_dynpro using 'SAPLS38E' '0400'.

perform bdc_field using 'BDC_OKCODE'

'/EWB_BACK'.

perform bdc_field using 'BDC_CURSOR'

'RSTXP-TDLINE(01)'.

perform bdc_field using 'RSTXP-TDFIRST'

' 1'.

perform bdc_dynpro using 'SAPLWBABAP' '0100'.

perform bdc_field using 'BDC_CURSOR'

'RS38M-PROGRAMM'.

perform bdc_field using 'BDC_OKCODE'

'=BACK'.

perform bdc_field using 'RS38M-PROGRAMM'

S_PRG01.

perform bdc_field using 'RS38M-FUNC_EDIT'

'X'.

perform CALL_transaction using 'SE38'.

Former Member
0 Kudos
76

Hi,

I am just considering another way,Instead of using pattern to insert commnet .. is it posiible to take the comment entries form a flat file i.e as input .

Using this comments could be added to the first lines . However Activation of the programs is still a problem and maybe u need to do mass activation of programs form SE38.

0 Kudos
76

Hi,

I have solved the pattern problem. I also solved the activation of the program. It works perfectly fine during the BDC session. So I exported into a include program and I copy out the code to put inside my program and does not work. What the problem could be? Thanks for replying.

=========================================================

START-OF-SELECTION.

PERFORM OPEN_GROUP.

loop at t_trdir.

PERFORM BDC_COPYRIGHT.

endloop.

PERFORM CLOSE_GROUP.

END-OF-SELECTION.

FORM open_group.

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

CLIENT = SY-MANDT

GROUP = P_GROUP

HOLDDATE = SY-DATUM

KEEP = 'X'

USER = SY-UNAME.

ENDFORM. " open_group

FORM close_group.

CALL FUNCTION 'BDC_CLOSE_GROUP'.

ENDFORM. " close_group

FORM BDC_TRANSACTION USING TCODE.

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = TCODE

TABLES

DYNPROTAB = BDCDATA.

ENDFORM. " BDC_TRANSACTION

FORM BDC_COPYRIGHT.

perform bdc_dynpro using 'SAPLWBABAP' '0100'.

perform bdc_field using 'BDC_CURSOR'

'RS38M-PROGRAMM'.

perform bdc_field using 'BDC_OKCODE'

'=CHAP'.

perform bdc_field using 'RS38M-PROGRAMM'

t_trdir-name.

perform bdc_field using 'RS38M-FUNC_EDIT'

'X'.

perform bdc_dynpro using 'SAPLS38E' '0400'.

perform bdc_field using 'BDC_OKCODE'

'=ED_INS_FRAME'.

perform bdc_dynpro using 'SAPLLOCAL_EDT1' '2520'.

perform bdc_field using 'BDC_CURSOR'

'RSTXP-TDANWEISNG'.

perform bdc_field using 'BDC_OKCODE'

'=PACO'.

perform bdc_field using 'MARK2'

''.

perform bdc_field using 'MARK13'

'.'.

perform bdc_field using 'MARK3'

'.'.

perform bdc_field using 'RSTXP-TDID'

'00'.

perform bdc_field using 'RSTXP-TDTYP'

'E'.

perform bdc_field using 'MARK1'

'.'.

perform bdc_field using 'MARK8'

'.'.

perform bdc_field using 'MARK7'

'.'.

perform bdc_field using 'MARK11'

'.'.

perform bdc_field using 'MARK12'

'.'.

perform bdc_field using 'MARK5'

'.'.

perform bdc_field using 'MARK9'

'X'.

perform bdc_field using 'MARK10'

'.'.

perform bdc_field using 'MARK6'

'.'.

perform bdc_field using 'MARK4'

'X'.

perform bdc_field using 'RSTXP-TDANWEISNG'

'zcopyright'.

perform bdc_dynpro using 'SAPLS38E' '0400'.

perform bdc_field using 'BDC_OKCODE'

'=WB_SAVE'.

  • perform bdc_field using 'BDC_CURSOR'

  • 'RSTXP-TDLINE(01)'.

perform bdc_field using 'RSTXP-TDFIRST'

' 1'.

perform bdc_transaction using 'SE38'.

perform bdc_dynpro using 'SAPLWBABAP' '0100'.

perform bdc_field using 'BDC_CURSOR'

'RS38M-PROGRAMM'.

perform bdc_field using 'BDC_OKCODE'

'=AKTI'.

perform bdc_field using 'RS38M-PROGRAMM'

t_trdir-name.

perform bdc_field using 'RS38M-FUNC_EDIT'

'X'.

perform bdc_dynpro using 'SAPLSEWORKINGAREA' '0200'.

perform bdc_field using 'BDC_OKCODE'

'=WEIT'.

perform bdc_dynpro using 'SAPLWBABAP' '0100'.

perform bdc_field using 'BDC_CURSOR'

'RS38M-PROGRAMM'.

perform bdc_field using 'BDC_OKCODE'

'=BACK'.

perform bdc_field using 'RS38M-PROGRAMM'

t_trdir-name.

perform bdc_field using 'RS38M-FUNC_EDIT'

'X'.

perform bdc_transaction using 'SE38'.

ENDFORM. " BDC_COPYRIGHT

<i><b>Regards,

Shannon</b></i>