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 problem with back button

Former Member
0 Kudos

Hi all,

i have idoc number in alv output.when the user clicks on this ,it should take the control to BD87 transaction with idoc number getting transferred there .also BD87 screen has changed on select option where the default is sy-datum .i need to clear this along with transfer of idoc number.

i tried using submit statement,but its not working.

then i used call transaction in error mode to acheive this functionality and i was sucessful.

beloe is my code:

REFRESH bdcdata.

READ TABLE t_out INTO wa_out INDEX rs_selfield-tabindex.

DATA: lv_mode(1) TYPE c VALUE 'E'.

PERFORM bdc_dynpro USING 'RBDMON00' '1100'.

PERFORM bdc_field USING 'BDC_CURSOR'

'SX_UPDDA-HIGH'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=CRET'.

PERFORM bdc_field USING 'SX_DOCNU-LOW'

wa_out-docnum.

PERFORM bdc_field USING 'SX_CRETI-LOW'

'00:00:00'.

PERFORM bdc_field USING 'SX_CRETI-HIGH'

'00:00:00'.

PERFORM bdc_field USING 'SX_UPDDA-LOW'

''.

PERFORM bdc_field USING 'SX_UPDDA-HIGH'

''.

PERFORM bdc_field USING 'SX_UPDTI-LOW'

'00:00:00'.

PERFORM bdc_field USING 'SX_UPDTI-HIGH'

'00:00:00'.

PERFORM bdc_call_transaction USING 'BD87' lv_mode 'N'.

So,the control directly takes me inside the BD87 screen just after the screen which we get after execting the selection screen of bd87 with idoc details

the problem is whn i click on back button or F3,the control does not take me back to the ALV output screen rather it takes me to the selection screen of BD87.

So,any way out to solve the back button problem???

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Kunal,

That's a really tough report to handle by submit.

You can try to call the transaction in error mode and place one moment to force the screen to appear. Then complete the BTCI with the last steps to exit the selection screen.

Try it like this:


REFRESH bdcdata.
READ TABLE t_out INTO wa_out INDEX rs_selfield-tabindex.

DATA: lv_mode(1) TYPE c VALUE 'E'.

PERFORM bdc_dynpro USING 'RBDMON00' '1100'.
PERFORM bdc_field USING 'BDC_CURSOR' 'SX_UPDDA-HIGH'.
PERFORM bdc_field USING 'BDC_OKCODE' '=CRET'.
PERFORM bdc_field USING 'SX_DOCNU-LOW' wa_out-docnum.
PERFORM bdc_field USING 'SX_CRETI-LOW' '00:00:00'.
PERFORM bdc_field USING 'SX_CRETI-HIGH' '00:00:00'.
PERFORM bdc_field USING 'SX_UPDDA-LOW' ''.
PERFORM bdc_field USING 'SX_UPDDA-HIGH' ''.
PERFORM bdc_field USING 'SX_UPDTI-LOW' '00:00:00'.
PERFORM bdc_field USING 'SX_UPDTI-HIGH' '00:00:00'.
*
*btci is interrupted in presentation of the result screen
*
*last steps to exit selection screen
PERFORM bdc_dynpro   USING 'RBDMON00' '1100'.
PERFORM bdc_field       USING 'BDC_OKCODE' '/ECBAC'.
PERFORM bdc_field       USING 'BDC_CURSOR' 'SX_UPDDA-LOW'.

*use error mode in call transaction
CALL TRANSACTION 'BD87' USING bdcdata MODE 'E'.
*PERFORM bdc_call_transaction USING 'BD87' lv_mode 'N'.

hope it helps,

Edgar

2 REPLIES 2

Former Member
0 Kudos

Hi Kunal,

That's a really tough report to handle by submit.

You can try to call the transaction in error mode and place one moment to force the screen to appear. Then complete the BTCI with the last steps to exit the selection screen.

Try it like this:


REFRESH bdcdata.
READ TABLE t_out INTO wa_out INDEX rs_selfield-tabindex.

DATA: lv_mode(1) TYPE c VALUE 'E'.

PERFORM bdc_dynpro USING 'RBDMON00' '1100'.
PERFORM bdc_field USING 'BDC_CURSOR' 'SX_UPDDA-HIGH'.
PERFORM bdc_field USING 'BDC_OKCODE' '=CRET'.
PERFORM bdc_field USING 'SX_DOCNU-LOW' wa_out-docnum.
PERFORM bdc_field USING 'SX_CRETI-LOW' '00:00:00'.
PERFORM bdc_field USING 'SX_CRETI-HIGH' '00:00:00'.
PERFORM bdc_field USING 'SX_UPDDA-LOW' ''.
PERFORM bdc_field USING 'SX_UPDDA-HIGH' ''.
PERFORM bdc_field USING 'SX_UPDTI-LOW' '00:00:00'.
PERFORM bdc_field USING 'SX_UPDTI-HIGH' '00:00:00'.
*
*btci is interrupted in presentation of the result screen
*
*last steps to exit selection screen
PERFORM bdc_dynpro   USING 'RBDMON00' '1100'.
PERFORM bdc_field       USING 'BDC_OKCODE' '/ECBAC'.
PERFORM bdc_field       USING 'BDC_CURSOR' 'SX_UPDDA-LOW'.

*use error mode in call transaction
CALL TRANSACTION 'BD87' USING bdcdata MODE 'E'.
*PERFORM bdc_call_transaction USING 'BD87' lv_mode 'N'.

hope it helps,

Edgar

0 Kudos

hi,

Thanks for the reply.The problem is solved