Application Development and Automation 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: 
Read only

transaction error

Former Member
0 Likes
477

Hai evey one! i a m creating bdc program for two customer ganerated tcodes (create quotation and change quotation ).

I want to generate two sessions one for each. I succesfully generated two sessions .

When i run the sessions iam getting two errors for change quotation 1. 'transaction error ' 2. No batch input data for screen ZFPSPM002 0100 . One error (Quotation NUmber already exist ) for create quotation .From second transaction onwards .ie only first record is being created succesfully. Actually i prevalidated the quotation numbers for their existance and they are not there actually there . When I run the program and session again one (next) transaction is succesful . Can anyone give me some solution .Pl see the two subroutines below . Is 'open_session' and 'close_session' in correct position ? or they should be inside the loop ?

thank you

&----


*& Form create_quote

&----


FORM create_quote .

perform open_group using 'create_quote'.

loop at gt_get_datum into gw_get_datum where act_code = 'C'.

tot_cr_recs = tot_cr_recs + '1' .

perform bdc_dynpro using 'ZFPSPM001' '0100'.

perform bdc_field using 'BDC_CURSOR'

'SCR-SPROJ_NUM'.

perform bdc_field using 'BDC_OKCODE'

'=ACRT'.

perform bdc_field using 'SCR-SPROJ_NUM'

gw_get_datum-posid.

perform bdc_dynpro using 'ZFPSPM001' '0200'.

perform bdc_field using 'BDC_CURSOR'

'SCR-SQUOT_NUM'.

perform bdc_field using 'BDC_OKCODE'

'/00'. .

perform bdc_field using 'SCR-SQUOT_AMT'

gw_get_datum-quote_amt.

perform bdc_field using 'SCR-SCUST_NUM'

gw_get_datum-kunnr.

perform bdc_field using 'SCR-SCUST_NAME1'

'name'.

perform bdc_field using 'SCR-SCUST_STREET'

'street'.

*perform bdc_field using 'SCR-SCRT_DAT'

  • gw_get_datum-quote_cdte.

perform bdc_field using 'SCR-SEXP_DAT'

gw_get_datum-quote_edte.

perform bdc_field using 'SCR-SGST_IND'

gw_get_datum-mwskz .

perform bdc_field using 'SCR-SQUOT_NUM'

gw_get_datum-quote_num.

perform bdc_dynpro using 'ZFPSPM001' '0200'.

perform bdc_field using 'BDC_CURSOR'

'SCR-SQUOT_AMT'.

perform bdc_field using 'BDC_OKCODE'

'=SAVE'.

perform bdc_field using 'SCR-SQUOT_AMT'

gw_get_datum-quote_amt.

perform bdc_field using 'SCR-SCUST_NUM'

gw_get_datum-kunnr.

perform bdc_field using 'SCR-SCUST_NAME1'

'name'.

perform bdc_field using 'SCR-SCUST_STREET'

'street'.

*perform bdc_field using 'SCR-SCRT_DAT'

  • gw_get_datum-quote_cdte.

perform bdc_field using 'SCR-SEXP_DAT'

gw_get_datum-quote_edte.

perform bdc_field using 'SCR-SGST_IND'

gw_get_datum-mwskz.

perform bdc_field using 'SCR-SQUOT_NUM'

gw_get_datum-quote_num.

perform bdc_dynpro using 'ZFPSPM001' '0100'.

perform bdc_field using 'BDC_OKCODE'

'/EEXIT'.

perform bdc_field using 'BDC_CURSOR'

'SCR-SPROJ_NUM'.

perform bdc_insert using 'ZFPSTC001'.

endloop.

perform close_group.

ENDFORM. " create_quote

&----


*& Form change_quote

&----


FORM change_quote .

perform open_group using 'Change-quote'.

loop at gt_get_datum into gw_get_datum where act_code = 'M'.

tot_ch_recs = tot_ch_recs + '1' .

perform bdc_dynpro using 'ZFPSPM002' '0100'.

perform bdc_field using 'BDC_CURSOR'

'SCR-SQUOT_NUM'.

perform bdc_field using 'BDC_OKCODE'

'=ACHN'.

perform bdc_field using 'SCR-SPROJ_NUM'

gw_get_datum-posid.

perform bdc_field using 'SCR-SQUOT_NUM'

gw_get_datum-quote_num.

perform bdc_dynpro using 'ZFPSPM002' '0200'.

perform bdc_field using 'BDC_CURSOR'

'SCR-SCUST_NUM'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'SCR-SCUST_NUM'

gw_get_datum-kunnr.

perform bdc_field using 'SCR-SQUOT_AMT'

gw_get_datum-quote_amt.

perform bdc_field using 'SCR-SEXP_DAT'

gw_get_datum-quote_edte.

perform bdc_field using 'SCR-SGST_IND'

gw_get_datum-mwskz.

*perform bdc_field using 'SCR-SCOST_IND'

  • 'A00001'.

perform bdc_field using 'SCR-SCAP_AMT'

gw_get_datum-cap_amt.

*perform bdc_field using 'SRNA'

  • 'X'.

perform bdc_dynpro using 'ZFPSPM002' '0200'.

perform bdc_field using 'BDC_CURSOR'

'SCR-SCUST_NUM'.

perform bdc_field using 'BDC_OKCODE'

'=SAVE'.

perform bdc_field using 'SCR-SCUST_NUM'

gw_get_datum-kunnr.

perform bdc_field using 'SCR-SQUOT_AMT'

gw_get_datum-quote_amt.

perform bdc_field using 'SCR-SEXP_DAT'

gw_get_datum-quote_edte.

perform bdc_field using 'SCR-SGST_IND'

gw_get_datum-mwskz.

*perform bdc_field using 'SCR-SCOST_IND'

perform bdc_field using 'SCR-SCAP_AMT'

gw_get_datum-cap_amt.

*perform bdc_field using 'SRNA'

  • 'X'.

perform bdc_dynpro using 'ZFPSPM002' '0100'.

perform bdc_field using 'BDC_OKCODE'

'/EEXIT'.

perform bdc_field using 'BDC_CURSOR'

'SCR-SPROJ_NUM'.

perform bdc_insert using 'ZFPSTC002'.

endloop.

perform close_group.

ENDFORM. " change_quote

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
458

1 ) make sure you refresh your bdc-internal table after each bdc_insert.

2 ) make sure you don't open 2 sessions at the same time, i.e. if you open your session for change quote, the session for create quote should be closed.

3 REPLIES 3
Read only

Former Member
0 Likes
459

1 ) make sure you refresh your bdc-internal table after each bdc_insert.

2 ) make sure you don't open 2 sessions at the same time, i.e. if you open your session for change quote, the session for create quote should be closed.

Read only

0 Likes
458

Hai Kris ! your suggestion solved one problem ie. create quotation . Thank you

Read only

0 Likes
458

Error ( No batch input data for screen ZFPSPM002 0100. ) means that your screen flow in the change routine is not correct. Did you already run your session in foreground to see where it goes wrong? Was the session created via a recording (SM35, create recording)? This can be very useful to determine which screens are needed and it which sequence...