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: 

Modifying Transaction FF68(URGENT)

pradiptakumar_mishra
Participant
0 Kudos

Dear All,

I need to add a new field in screen 8000 of Transaction FF68. I made another transaction YFF68 and added that field.

When am running SM35(for yff68) , it calls FB01 where there is a field called Account(RF05A-NEWKO) which gets value in the initial screen. But not after the main screen.

The field is same in the follow up screen.

Can anyone pls guide me how to solve this issue ?

Awaiting your soonest response.

Pradipta K. Mishra

1 ACCEPTED SOLUTION

former_member184569
Active Contributor
0 Kudos

Hi Pradipta,

I am having the bdc for a similar transaction FBV1.

Here as you said, we are having the posting key and the account number in the first screen, though its needed in the next screen.

I am sending you a part of the bdc code for that.. Hope that it will be useful.

DATA: BEGIN OF infile OCCURS 0,

rec_type(01) TYPE c,

post_key(02) TYPE c,

fill_01(08) TYPE c,

accnt(10) TYPE c,

fill_02(04) TYPE c,

amount(16) TYPE c,

business_area(03) TYPE c,

fill_03(06) TYPE c,

special_gl(01) TYPE c,

fill_04(05) TYPE c,

order(10) TYPE c,

fill_05(25) TYPE c,

text(50) TYPE c,

fill_07(65) TYPE c,

due_on_date(8) TYPE c,

dollar_amt TYPE p DECIMALS 2,

sort_field(13) TYPE c,

fill_06(05) TYPE c,

END OF infile.

FORM process_infile.

*----


  • This routine loops through the Infile Table created from the input

  • file and creates the appropriate BDC transactions necessary to

  • input the data into SAP

*----


MOVE: 0 TO sy-subrc.

SORT infile BY business_area amount post_key.

LOOP AT infile.

PERFORM create_bdc.

ENDLOOP.

  • Handle the last break occurring because at end of file

IF abend_job = false.

MOVE: true TO eoj.

PERFORM format_scrn_0300_last.

PERFORM insert_bdcdata.

ENDIF.

ENDFORM.

FORM create_bdc.

*----


  • Include logic applicable to Interface that is necessary to format

  • the necessary BDC screens.

*----


sy-subrc = 0.

IF new_bdc EQ true.

PERFORM open_bdc.

IF abend_job = true.

EXIT.

ENDIF.

ENDIF.

IF first_time = true.

CLEAR ba_cnt_tab.

PERFORM format_scrn_0100.

PERFORM format_break_fields.

ELSEIF infile-business_area NE prev_business_area OR

detail_rec_cnt = 500.

PERFORM format_scrn_0300_last.

PERFORM insert_bdcdata.

IF abend_job = false.

MOVE: true TO bdc_tab_created.

PERFORM format_scrn_0100.

PERFORM format_break_fields.

ENDIF.

ELSE.

PERFORM format_scrn_0300_detail.

PERFORM format_break_fields.

ENDIF.

IF abend_job = false.

IF first_time = true.

MOVE: true TO bdc_tab_created,

false TO first_time.

ENDIF.

ELSE.

EXIT.

ENDIF.

ENDFORM.

************************************************************************

  • Format Break Fields

FORM format_break_fields.

*----


  • This form format fields necessary for breaking logic and postions

  • the BA_CNT_TAB at the Business Area being processed.

MOVE: infile-business_area TO prev_business_area,

infile-post_key TO prev_pk,

infile-amount TO prev_amount,

infile-dollar_amt TO prev_dollar_amt,

infile-order TO prev_order,

infile-text TO prev_text,

infile-due_on_date TO prev_due_on_date.

ENDFORM.

************************************************************************

  • format screen 0100

FORM format_scrn_0100.

*----


  • This form contains the logic to create screen 0100

sy-subrc = 0.

IF ba_cnt_tab-business_area NE infile-business_area.

  • Position BA_CNT_TAB at business area currently processing.

LOOP AT ba_cnt_tab.

IF ba_cnt_tab-business_area = infile-business_area.

EXIT.

ENDIF.

ENDLOOP.

ENDIF.

PERFORM dynpro_saplf040_0100 USING infile-post_key infile-accnt.

ENDFORM.

************************************************************************

  • FORMAT SCREEN 0300 FOR LAST DETAIL

FORM format_scrn_0300_last.

*----


  • This form formats the last detail screen 0300 and a phantom entry

  • if needed. Screen 0002 is also formatted for each 0300.

ADD: prev_dollar_amt TO phantom_accum,

1 TO detail_rec_cnt.

IF prev_dollar_amt GT 0.

ADD: prev_dollar_amt TO amt_debit_added.

ELSE.

ADD: prev_dollar_amt TO amt_credit_added.

ENDIF.

IF detail_rec_cnt LT ba_cnt_tab-rec_cnt.

IF phantom_accum LT 0.

  • Reverse posting key since being posted as an offset to the accumulated

  • Amount.

MOVE debit_pk40 TO posting_key.

num_data = phantom_accum * -1.

ELSE.

MOVE credit_pk50 TO posting_key.

num_data = phantom_accum.

ENDIF.

PERFORM dynpro_saplf040_0300 USING prev_amount prev_text

prev_due_on_date posting_key phantom_accnt ' '.

IF prev_pk = '40' OR

prev_pk = '50'.

PERFORM dynpro_saplkacb_0002 USING

prev_business_area prev_order.

ENDIF.

MOVE: num_data TO char_data,

posting_key TO prev_pk.

PERFORM dynpro_saplf040_0300 USING char_data '' '' '' '' ''.

PERFORM bdc_value USING 'BDC_OKCODE' post.

PERFORM dynpro_saplkacb_0002 USING prev_business_area ' '.

ELSE.

PERFORM dynpro_saplf040_0300 USING prev_amount prev_text

prev_due_on_date '' '' ''.

PERFORM bdc_value USING 'BDC_OKCODE' post.

IF prev_pk = '40' OR

prev_pk = '50'.

PERFORM dynpro_saplkacb_0002 USING

prev_business_area prev_order.

ENDIF.

ENDIF.

CLEAR: detail_rec_cnt,

phantom_accum.

ENDFORM.

************************************************************************

  • FORMAT DETAIL FOR SCREEN 0300

FORM format_scrn_0300_detail.

*----


  • This FORM formats screen 0300 for a detail record along with its

  • screen 0002

ADD: prev_dollar_amt TO phantom_accum.

PERFORM dynpro_saplf040_0300 USING prev_amount prev_text

prev_due_on_date infile-post_key infile-accnt infile-special_gl.

IF prev_pk = '40' OR

prev_pk = '50'.

PERFORM dynpro_saplkacb_0002 USING

prev_business_area prev_order.

ENDIF.

IF prev_dollar_amt LT 0.

ADD: prev_dollar_amt TO amt_credit_added.

ELSE.

ADD: prev_dollar_amt TO amt_debit_added.

ENDIF.

ADD: 1 TO detail_rec_cnt.

ENDFORM.

************************************************************************

  • Dynpro for program SAPLF040 Screen 0100

FORM dynpro_saplf040_0100 USING post_key post_accnt.

*----


  • This FORM formats SCREEN 0100

*----


  • This PERFORM is done once for each screen.

PERFORM bdc_dynpro USING 'SAPLF040' '0100'.

  • This PERFORM is done as many times as there are fields to be

  • populated for the screen being processed.

PERFORM bdc_value USING 'BKPF-BLDAT' header-doc_mdy.

PERFORM bdc_value USING 'BKPF-BUDAT' header-post_mdy.

PERFORM bdc_value USING 'BKPF-BLART' header-doc_type.

PERFORM bdc_value USING 'BKPF-BUKRS' header-company_code.

PERFORM bdc_value USING 'BKPF-MONAT' header-period.

PERFORM bdc_value USING 'BKPF-WAERS' header-currency.

PERFORM bdc_value USING 'BKPF-XBLNR' header-reference_doc.

PERFORM bdc_value USING 'BKPF-BKTXT' header-text.

PERFORM bdc_value USING 'RF05V-NEWBS' post_key.

PERFORM bdc_value USING 'RF05V-NEWKO' post_accnt.

PERFORM bdc_value USING 'RF05V-NEWUM' infile-special_gl.

ENDFORM.

************************************************************************

  • Dynpro for program SAPLF040 Screen 0300

FORM dynpro_saplf040_0300 USING amount text due_on_date

post_key post_accnt special_gl.

*----


  • This FORM formats SCREEN 0300

*----


  • This PERFORM is done once for each screen.

IF prev_pk = '01' OR prev_pk = '11'.

PERFORM bdc_dynpro USING 'SAPLF040' '0301'.

PERFORM bdc_value USING 'BSEG-ZLSCH' pymnt_mth.

PERFORM bdc_value USING 'BSEG-ZLSPR' pymnt_blk.

ELSEIF prev_pk = '09' OR

prev_pk = '19'.

PERFORM bdc_dynpro USING 'SAPLF040' '0303'.

PERFORM bdc_value USING 'BSEG-ZFBDT' header-doc_mdy.

ELSE.

PERFORM bdc_dynpro USING 'SAPLF040' '0300'.

ENDIF.

  • This PERFORM is done as many times as there are fields to be

  • populated for the screen being processed.

PERFORM bdc_value USING 'BSEG-WRBTR' amount.

PERFORM bdc_value USING 'RF05V-NEWBS' post_key.

PERFORM bdc_value USING 'RF05V-NEWKO' post_accnt.

PERFORM bdc_value USING 'RF05V-NEWUM' special_gl.

IF text NE space.

PERFORM bdc_value USING 'BSEG-SGTXT' text.

ENDIF.

IF due_on_date NE space.

PERFORM bdc_value USING 'BSEG-ZFBDT' due_on_date.

PERFORM bdc_value USING 'BSEG-VALUT' due_on_date.

ENDIF.

IF no_ba_flg = 'N'.

IF prev_pk = '09' OR

prev_pk = '19' OR

prev_pk = '11' OR

prev_pk = '01'.

PERFORM bdc_value USING 'BSEG-GSBER' prev_business_area.

ENDIF.

ENDIF.

PERFORM bdc_value USING 'BSEG-ZUONR' assign_text.

ENDFORM.

************************************************************************

  • Dynpro for program SAPLKACB Screen 0002

FORM dynpro_saplkacb_0002 USING business_area order.

*----


  • This FORM formats SCREEN 0002 WHICH IS A POP-UP SCREEN

  • THAT DOES NOT APPEAR DURING ON-LINE PROCESSING

*----


  • This PERFORM is done once for each screen.

PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.

  • This PERFORM is done as many times as there are fields to be

  • populated for the screen being processed.

IF business_area NE '700'.

PERFORM bdc_value USING 'COBL-GSBER' business_area.

ENDIF.

IF order NE space.

PERFORM bdc_value USING 'COBL-AUFNR' order.

ENDIF.

ENDFORM.

************************************************************************

  • BDC Dynpro

FORM bdc_dynpro USING pgm scrn.

*----


  • This FORM formats the transaction that tells the BDC which screen is

  • to be populated.

*----


CLEAR bdc_tab.

MOVE: pgm TO bdc_tab-program,

scrn TO bdc_tab-dynpro,

begin TO bdc_tab-dynbegin.

APPEND bdc_tab.

ENDFORM.

************************************************************************

  • BDC Value

FORM bdc_value USING field val.

*----


  • This FORM tells the BDC which field is to be populated and the value

  • to use.

*----


CLEAR bdc_tab.

MOVE: field TO bdc_tab-fnam,

val TO bdc_tab-fval.

APPEND bdc_tab.

ENDFORM.

INCLUDE zi000002.

************************************************************************

Regards,

Susmitha

2 REPLIES 2

former_member184569
Active Contributor
0 Kudos

Hi Pradipta,

I am having the bdc for a similar transaction FBV1.

Here as you said, we are having the posting key and the account number in the first screen, though its needed in the next screen.

I am sending you a part of the bdc code for that.. Hope that it will be useful.

DATA: BEGIN OF infile OCCURS 0,

rec_type(01) TYPE c,

post_key(02) TYPE c,

fill_01(08) TYPE c,

accnt(10) TYPE c,

fill_02(04) TYPE c,

amount(16) TYPE c,

business_area(03) TYPE c,

fill_03(06) TYPE c,

special_gl(01) TYPE c,

fill_04(05) TYPE c,

order(10) TYPE c,

fill_05(25) TYPE c,

text(50) TYPE c,

fill_07(65) TYPE c,

due_on_date(8) TYPE c,

dollar_amt TYPE p DECIMALS 2,

sort_field(13) TYPE c,

fill_06(05) TYPE c,

END OF infile.

FORM process_infile.

*----


  • This routine loops through the Infile Table created from the input

  • file and creates the appropriate BDC transactions necessary to

  • input the data into SAP

*----


MOVE: 0 TO sy-subrc.

SORT infile BY business_area amount post_key.

LOOP AT infile.

PERFORM create_bdc.

ENDLOOP.

  • Handle the last break occurring because at end of file

IF abend_job = false.

MOVE: true TO eoj.

PERFORM format_scrn_0300_last.

PERFORM insert_bdcdata.

ENDIF.

ENDFORM.

FORM create_bdc.

*----


  • Include logic applicable to Interface that is necessary to format

  • the necessary BDC screens.

*----


sy-subrc = 0.

IF new_bdc EQ true.

PERFORM open_bdc.

IF abend_job = true.

EXIT.

ENDIF.

ENDIF.

IF first_time = true.

CLEAR ba_cnt_tab.

PERFORM format_scrn_0100.

PERFORM format_break_fields.

ELSEIF infile-business_area NE prev_business_area OR

detail_rec_cnt = 500.

PERFORM format_scrn_0300_last.

PERFORM insert_bdcdata.

IF abend_job = false.

MOVE: true TO bdc_tab_created.

PERFORM format_scrn_0100.

PERFORM format_break_fields.

ENDIF.

ELSE.

PERFORM format_scrn_0300_detail.

PERFORM format_break_fields.

ENDIF.

IF abend_job = false.

IF first_time = true.

MOVE: true TO bdc_tab_created,

false TO first_time.

ENDIF.

ELSE.

EXIT.

ENDIF.

ENDFORM.

************************************************************************

  • Format Break Fields

FORM format_break_fields.

*----


  • This form format fields necessary for breaking logic and postions

  • the BA_CNT_TAB at the Business Area being processed.

MOVE: infile-business_area TO prev_business_area,

infile-post_key TO prev_pk,

infile-amount TO prev_amount,

infile-dollar_amt TO prev_dollar_amt,

infile-order TO prev_order,

infile-text TO prev_text,

infile-due_on_date TO prev_due_on_date.

ENDFORM.

************************************************************************

  • format screen 0100

FORM format_scrn_0100.

*----


  • This form contains the logic to create screen 0100

sy-subrc = 0.

IF ba_cnt_tab-business_area NE infile-business_area.

  • Position BA_CNT_TAB at business area currently processing.

LOOP AT ba_cnt_tab.

IF ba_cnt_tab-business_area = infile-business_area.

EXIT.

ENDIF.

ENDLOOP.

ENDIF.

PERFORM dynpro_saplf040_0100 USING infile-post_key infile-accnt.

ENDFORM.

************************************************************************

  • FORMAT SCREEN 0300 FOR LAST DETAIL

FORM format_scrn_0300_last.

*----


  • This form formats the last detail screen 0300 and a phantom entry

  • if needed. Screen 0002 is also formatted for each 0300.

ADD: prev_dollar_amt TO phantom_accum,

1 TO detail_rec_cnt.

IF prev_dollar_amt GT 0.

ADD: prev_dollar_amt TO amt_debit_added.

ELSE.

ADD: prev_dollar_amt TO amt_credit_added.

ENDIF.

IF detail_rec_cnt LT ba_cnt_tab-rec_cnt.

IF phantom_accum LT 0.

  • Reverse posting key since being posted as an offset to the accumulated

  • Amount.

MOVE debit_pk40 TO posting_key.

num_data = phantom_accum * -1.

ELSE.

MOVE credit_pk50 TO posting_key.

num_data = phantom_accum.

ENDIF.

PERFORM dynpro_saplf040_0300 USING prev_amount prev_text

prev_due_on_date posting_key phantom_accnt ' '.

IF prev_pk = '40' OR

prev_pk = '50'.

PERFORM dynpro_saplkacb_0002 USING

prev_business_area prev_order.

ENDIF.

MOVE: num_data TO char_data,

posting_key TO prev_pk.

PERFORM dynpro_saplf040_0300 USING char_data '' '' '' '' ''.

PERFORM bdc_value USING 'BDC_OKCODE' post.

PERFORM dynpro_saplkacb_0002 USING prev_business_area ' '.

ELSE.

PERFORM dynpro_saplf040_0300 USING prev_amount prev_text

prev_due_on_date '' '' ''.

PERFORM bdc_value USING 'BDC_OKCODE' post.

IF prev_pk = '40' OR

prev_pk = '50'.

PERFORM dynpro_saplkacb_0002 USING

prev_business_area prev_order.

ENDIF.

ENDIF.

CLEAR: detail_rec_cnt,

phantom_accum.

ENDFORM.

************************************************************************

  • FORMAT DETAIL FOR SCREEN 0300

FORM format_scrn_0300_detail.

*----


  • This FORM formats screen 0300 for a detail record along with its

  • screen 0002

ADD: prev_dollar_amt TO phantom_accum.

PERFORM dynpro_saplf040_0300 USING prev_amount prev_text

prev_due_on_date infile-post_key infile-accnt infile-special_gl.

IF prev_pk = '40' OR

prev_pk = '50'.

PERFORM dynpro_saplkacb_0002 USING

prev_business_area prev_order.

ENDIF.

IF prev_dollar_amt LT 0.

ADD: prev_dollar_amt TO amt_credit_added.

ELSE.

ADD: prev_dollar_amt TO amt_debit_added.

ENDIF.

ADD: 1 TO detail_rec_cnt.

ENDFORM.

************************************************************************

  • Dynpro for program SAPLF040 Screen 0100

FORM dynpro_saplf040_0100 USING post_key post_accnt.

*----


  • This FORM formats SCREEN 0100

*----


  • This PERFORM is done once for each screen.

PERFORM bdc_dynpro USING 'SAPLF040' '0100'.

  • This PERFORM is done as many times as there are fields to be

  • populated for the screen being processed.

PERFORM bdc_value USING 'BKPF-BLDAT' header-doc_mdy.

PERFORM bdc_value USING 'BKPF-BUDAT' header-post_mdy.

PERFORM bdc_value USING 'BKPF-BLART' header-doc_type.

PERFORM bdc_value USING 'BKPF-BUKRS' header-company_code.

PERFORM bdc_value USING 'BKPF-MONAT' header-period.

PERFORM bdc_value USING 'BKPF-WAERS' header-currency.

PERFORM bdc_value USING 'BKPF-XBLNR' header-reference_doc.

PERFORM bdc_value USING 'BKPF-BKTXT' header-text.

PERFORM bdc_value USING 'RF05V-NEWBS' post_key.

PERFORM bdc_value USING 'RF05V-NEWKO' post_accnt.

PERFORM bdc_value USING 'RF05V-NEWUM' infile-special_gl.

ENDFORM.

************************************************************************

  • Dynpro for program SAPLF040 Screen 0300

FORM dynpro_saplf040_0300 USING amount text due_on_date

post_key post_accnt special_gl.

*----


  • This FORM formats SCREEN 0300

*----


  • This PERFORM is done once for each screen.

IF prev_pk = '01' OR prev_pk = '11'.

PERFORM bdc_dynpro USING 'SAPLF040' '0301'.

PERFORM bdc_value USING 'BSEG-ZLSCH' pymnt_mth.

PERFORM bdc_value USING 'BSEG-ZLSPR' pymnt_blk.

ELSEIF prev_pk = '09' OR

prev_pk = '19'.

PERFORM bdc_dynpro USING 'SAPLF040' '0303'.

PERFORM bdc_value USING 'BSEG-ZFBDT' header-doc_mdy.

ELSE.

PERFORM bdc_dynpro USING 'SAPLF040' '0300'.

ENDIF.

  • This PERFORM is done as many times as there are fields to be

  • populated for the screen being processed.

PERFORM bdc_value USING 'BSEG-WRBTR' amount.

PERFORM bdc_value USING 'RF05V-NEWBS' post_key.

PERFORM bdc_value USING 'RF05V-NEWKO' post_accnt.

PERFORM bdc_value USING 'RF05V-NEWUM' special_gl.

IF text NE space.

PERFORM bdc_value USING 'BSEG-SGTXT' text.

ENDIF.

IF due_on_date NE space.

PERFORM bdc_value USING 'BSEG-ZFBDT' due_on_date.

PERFORM bdc_value USING 'BSEG-VALUT' due_on_date.

ENDIF.

IF no_ba_flg = 'N'.

IF prev_pk = '09' OR

prev_pk = '19' OR

prev_pk = '11' OR

prev_pk = '01'.

PERFORM bdc_value USING 'BSEG-GSBER' prev_business_area.

ENDIF.

ENDIF.

PERFORM bdc_value USING 'BSEG-ZUONR' assign_text.

ENDFORM.

************************************************************************

  • Dynpro for program SAPLKACB Screen 0002

FORM dynpro_saplkacb_0002 USING business_area order.

*----


  • This FORM formats SCREEN 0002 WHICH IS A POP-UP SCREEN

  • THAT DOES NOT APPEAR DURING ON-LINE PROCESSING

*----


  • This PERFORM is done once for each screen.

PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.

  • This PERFORM is done as many times as there are fields to be

  • populated for the screen being processed.

IF business_area NE '700'.

PERFORM bdc_value USING 'COBL-GSBER' business_area.

ENDIF.

IF order NE space.

PERFORM bdc_value USING 'COBL-AUFNR' order.

ENDIF.

ENDFORM.

************************************************************************

  • BDC Dynpro

FORM bdc_dynpro USING pgm scrn.

*----


  • This FORM formats the transaction that tells the BDC which screen is

  • to be populated.

*----


CLEAR bdc_tab.

MOVE: pgm TO bdc_tab-program,

scrn TO bdc_tab-dynpro,

begin TO bdc_tab-dynbegin.

APPEND bdc_tab.

ENDFORM.

************************************************************************

  • BDC Value

FORM bdc_value USING field val.

*----


  • This FORM tells the BDC which field is to be populated and the value

  • to use.

*----


CLEAR bdc_tab.

MOVE: field TO bdc_tab-fnam,

val TO bdc_tab-fval.

APPEND bdc_tab.

ENDFORM.

INCLUDE zi000002.

************************************************************************

Regards,

Susmitha

Former Member
0 Kudos

HI

GOOD

AS YOU HAVE MENTIONED IN YOUR REQUIREMENT

IF YOU R RUNNING THE TCODE YFF68 THAN IT SHOULD CALL YOUR 8000 SCREEN BUT IT IS CALLING FB01 WHICH IS POST DOCUMENT HEADER DATA.

MY QUESTION IS WHY ITS CLALING FB01 IF YOU HAVE CREATE THE TCODE FOR 8000.

AND WHAT DO YOU MEAN BY INITIAL SCREEN AND MAIN SCREEN AND FOLLOW UP SCREEN.

CAN YOU GIVE ME THESE DETAIL ASAP,I HOPE I CAN HELP YOU MORE AFTER THAT.

THANKS

MRUTYUN