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: 

Gurus...need URGENT help...Please understand...?

Former Member
0 Kudos

Gurus,

I had written a BDC program for FV50 transaction..As it is an ENJOY transaction once u enter the company code it doesnt ask for the company code again if second time u go to this transaction...so to do this i made changes in the EDITING options and was able to do a BDC program for parking FI GL document..I made this BDC program a part of a Function module...when i call this FM from another program and pass the correct parameters it does not work...i have tried all the the tweaks but it doesnt work...it gives a error NO batch input available for screen SAPFM050 1001...

please help...

What shud i do...please suggest...

Thanks

Sam

Message was edited by:

Sam williams

1 ACCEPTED SOLUTION

JozsefSzikszai
Active Contributor
0 Kudos

hi,

there is a pushbutton called 'Company Code' you can always select the company code with this 8at the beginning of each posting). You can reach it from menu as well (Edit / Change company code)

hope this helps

ec

21 REPLIES 21

Former Member
0 Kudos

Do you mean the error is on SAPMF05A 1001?

Rob

Pawan_Kesari
Active Contributor
0 Kudos

'once u enter the company code it doesnt ask for the company code again'

To correct this problem clear the parameter id of company code BUK before calling the transaction in BDC ..

JozsefSzikszai
Active Contributor
0 Kudos

hi,

there is a pushbutton called 'Company Code' you can always select the company code with this 8at the beginning of each posting). You can reach it from menu as well (Edit / Change company code)

hope this helps

ec

0 Kudos

Thanks for the reply gurus....I have captured that push button eric that u r talking about in my BDC...wheni call my custom function module which has the BDC program for parking then i get this error...i made changes in the FM so that i can see where does the error occurs...it stops at the first screen only....SAPMF050....

Pavan, how can i clear parameter ID will that work....

Please suggest.....

0 Kudos

I guess this is the ususal problem, when transaction behave differently in foreground and in background. When you record the transatction in SHDB, you have to tick: 'Not a BI session'

0 Kudos

Eric, I have done that and included that functionality in the code also....let me attach my code:

************************BDC PROGRAM**************************************************************

PERFORM bdc_dynpro TABLES t_bdcdata USING 'SAPLACHD' '1000'.

PERFORM bdc_field TABLES t_bdcdata USING 'BDC_CURSOR'

'BKPF-BUKRS'.

PERFORM bdc_field TABLES t_bdcdata USING 'BDC_OKCODE'

'=ENTR'.

PERFORM bdc_field TABLES t_bdcdata USING 'BKPF-BUKRS'

wa_document_header-comp_code.

PERFORM bdc_dynpro TABLES t_bdcdata USING 'SAPMF05A'

wa_document_header-comp_code.

PERFORM bdc_field TABLES t_bdcdata USING 'BDC_OKCODE'

'=PBBP'.

PERFORM bdc_field TABLES t_bdcdata USING 'ACGL_HEAD-BLDAT'

wa_document_header-doc_date.

PERFORM bdc_field TABLES t_bdcdata USING 'ACGL_HEAD-LDGRP'

var_ledger.

PERFORM bdc_field TABLES t_bdcdata USING 'ACGL_HEAD-BUDAT'

wa_document_header-pstng_date.

PERFORM bdc_field TABLES t_bdcdata USING 'ACGL_HEAD-XBLNR'

wa_document_header-ref_doc_no.

PERFORM bdc_field TABLES t_bdcdata USING 'ACGL_HEAD-BKTXT'

wa_document_header-header_txt.

PERFORM bdc_field TABLES t_bdcdata USING 'ACGL_HEAD-BLART'

wa_document_header-doc_type.

PERFORM bdc_field TABLES t_bdcdata USING 'BDC_CURSOR'

'ACGL_ITEM_GEN-GEN_CHAR2(02)'.

******Loop at the BDC Table to fill each line of items

LOOP AT t_bdc_document_item_main INTO wa_bdc_document_item_main.

idx = idx + 1.

ch3 = idx.

CONCATENATE 'ACGL_ITEM-HKONT('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_hkont.

CONCATENATE 'ACGL_ITEM-SHKZG('ch3')' INTO fname.

*****Transaction takes only H or S for Debit/Credit Indicator

IF wa_bdc_document_item_main-v_shkzg = 'C'.

var_shkzg = 'H'.

ELSEIF wa_bdc_document_item_main-v_shkzg = 'D'.

var_shkzg = 'S'.

ENDIF.

PERFORM bdc_field TABLES t_bdcdata USING fname

var_shkzg.

CONCATENATE 'ACGL_ITEM-WRBTR('ch3')' INTO fname.

MOVE: wa_bdc_document_item_main-v_wrbtr TO amount.

PERFORM bdc_field TABLES t_bdcdata USING fname

amount.

CONCATENATE 'ACGL_ITEM-SGTXT('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_sgtxt.

CONCATENATE 'ACGL_ITEM-PRCTR('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_prctr.

CONCATENATE 'ACGL_ITEM-KOSTL('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_kostl.

CONCATENATE 'ACGL_ITEM-BEWAR('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_bewar.

CONCATENATE 'ACGL_ITEM-VBUND('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_vbund.

CONCATENATE 'ACGL_ITEM_GEN-GEN_CHAR1('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_yylob.

CONCATENATE 'ACGL_ITEM_GEN-GEN_CHAR2('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_yycsg.

CONCATENATE 'ACGL_ITEM_GEN-GEN_CHAR3('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_yyprg.

CONCATENATE 'ACGL_ITEM_GEN-GEN_CHAR4('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_yydch.

CONCATENATE 'ACGL_ITEM_GEN-GEN_CHAR5('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_yymay.

CONCATENATE 'ACGL_ITEM-ZZITY('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_zzity.

CONCATENATE 'ACGL_ITEM-ZZSOU('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_zzsou.

CONCATENATE 'ACGL_ITEM-ZZPRO('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_zzpro.

CONCATENATE 'ACGL_ITEM-ZZACY('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_zzacy.

  • DI Fields added on 9/21/07

CONCATENATE 'ACGL_ITEM-ZZDIRNNAM('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_zzdirnnam.

CONCATENATE 'ACGL_ITEM-ZZDIRNTYP('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_zzdirntyp.

CONCATENATE 'ACGL_ITEM-ZZDIRNNUM('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_zzdirnnum.

CONCATENATE 'ACGL_ITEM-ZZDIFLNAM('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_zzdiflnam.

CONCATENATE 'ACGL_ITEM-ZZDIJRNID('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_zzdijrnid.

CONCATENATE 'ACGL_ITEM-ZZDIJRNLNK('ch3')' INTO fname.

PERFORM bdc_field TABLES t_bdcdata USING fname

wa_bdc_document_item_main-v_zzdijrnlnk.

  • End of Changes.

  • options-defsize = 'X'.

options-dismode = 'A'. "N - No Display = A - Display All

  • options-nobiend = 'X'.

options-nobinpt = 'X'.

ENDLOOP.

SET PARAMETER ID 'BUK' FIELD SPACE.

CALL TRANSACTION 'FV50L' USING t_bdcdata MESSAGES INTO

t_messages OPTIONS FROM options.

LOOP AT t_messages INTO wa_messages.

ADD 1 TO l_lines.

CALL FUNCTION 'MESSAGE_TEXT_BUILD'

EXPORTING

msgid = wa_messages-msgid

msgnr = wa_messages-msgnr

msgv1 = wa_messages-msgv1

msgv2 = wa_messages-msgv2

msgv3 = wa_messages-msgv3

msgv4 = wa_messages-msgv4

IMPORTING

message_text_output = wa_result-message.

MOVE:wa_result-message TO wa_return-message,

wa_messages-msgtyp TO wa_result-result_flag,

wa_messages-msgv1+0(10) TO wa_result-document_number,

wa_messages-msgv2+0(4) TO wa_result-comp_code.

APPEND wa_result TO tb_result.

APPEND wa_return TO t_return.

CLEAR: wa_result,

wa_return.

ENDLOOP.

return[] = t_return[].

ENDFUNCTION.

  • Form Definition for new screen

FORM bdc_dynpro TABLES it_bdcdata STRUCTURE bdcdata USING program

dynpro.

DATA: wa_bdcdata TYPE bdcdata.

wa_bdcdata-program = program.

wa_bdcdata-dynpro = dynpro.

wa_bdcdata-dynbegin = 'X'.

APPEND wa_bdcdata TO it_bdcdata.

ENDFORM. "BDC_DYNPRO

  • Form Definition to insert new field

FORM bdc_field TABLES it_bdcdata STRUCTURE bdcdata USING fnam fval.

DATA: wa_bdcdata TYPE bdcdata.

IF fval <> space.

CLEAR wa_bdcdata.

wa_bdcdata-fnam = fnam.

wa_bdcdata-fval = fval.

APPEND wa_bdcdata TO it_bdcdata.

ENDIF.

ENDFORM. "BDC_FIELD

0 Kudos

Also, Now i get the pop up and it gets fill but then it stops on the main screen....on the main screen it is not able to fill in data in all the fields....

it just waits on the main screen that is SAPMF05A 1001....

Do iahve to change my BDC program in any way.....please guide....

0 Kudos

than you should run the batch input in mode A (display all screens), then you'll see if a new screen comes up (which was not there at recording), or something works differently. It is the way to find out what is missing.

0 Kudos

I am doing that eric ...it stops on the main screen ....i am doing it in mode A...i am not able to understand why is it not working....

Thanks

0 Kudos

what is the screen name and number where you have the problem?

you wrote SAP<b>FM</b>050 1001, but there is no 1001 screen for SAP<b>MF</b>O50...

0 Kudos

It is SAPMF05A 1001....sorry about that...i am getting really nervous here..so....

Thanks

0 Kudos

That <i>was</i> the first question asked.

Rob

0 Kudos

Sorry about that Rob....it is in SAPMF05A 1001.....

I am not able to figure out what is going wrong and it getting real URGENT for me....

Will Appreciate ur help....

0 Kudos

Guys...please help....i have no help except SDN.....i am depending on all of you there....

Its reallly URGENT for me....

0 Kudos

Hi Sam,

Try to execute the function module from se37. I hope it should work properly from here. Try with A and N. Make sure there should not be any errors.

This type of problems may occur due whenever it is submitting to new session, I am not sure. If possible try to submit this to Immediate Background job instead of CALL Transaction. It sould work if you submit to Immediate Background job.

Let me know.

Plz Reward points.

Thanks and Regards,

Sampath.

0 Kudos

How shud i do that sampath....i have tried testing the FM separately....it works...and parks the FI document....but when called form another program it gives me an error No batch input data for screen SAPMF05A 1001....

what shud i do....

0 Kudos

Yes sam it sould throw an error. Because it should open a new session in background but this is a call transaction. So i hope it should not work.

Best, try to use Batch Input session. It would create a batch job.

Reward points.

Thanks and Regards,

Sampath

0 Kudos

Sampath how to do that...can u tell me thru coding....

0 Kudos

Sam,

Instead of Call transaction you have to use fm call BDC_OPEN_GROUP, BDC_SUBMIT and BDC_CLOSE_GROUP.

Thanks and Regards,

Sampath

0 Kudos

hOW SHUD I CHANGE THAT....will that help....nay gurus have any suggestions...

0 Kudos

Hi Sam,

Is it resolved.

If not,change the code...to call the above mentioned fm in place of CALL TRANSACTION <tcode> USING BDCDATA.

First call fm bdc_open_group

second call fm BDC_SUBMIT with BDCDATA

third call fm BDC_CLOSE_GROUP.