Skip to Content
0
Former Member
Dec 26, 2007 at 11:34 AM

BDC

64 Views

hi,

My program is a BDC using call transaction for T.code sm30. Here i am maintaining the data which is displayed in the list using call transaction.

report Z_CHANGE_FI_SL

no standard page heading line-size 255.

include zfi_restatement_top.

----


  • Data

----


data: j_final2 type standard table of ty_final.

data: wa_final2 type ty_final.

data: bdcdata like bdcdata occurs 0 with header line,

messtab like bdcmsgcoll occurs 0 with header line.

data: v_counter type n value '0',

n type i,

k type n value '0',

v_tarnbr(120) type c,

v_wbs_mask like zupi5a-rzzps_posid,

  • v_relation like query_tab-relation,

  • v_bool like query_tab-bool.

v_relation(20) type c,

v_bool(20) type c.

start-of-selection.

import i_final2 to j_final2 from memory id 'table'.

describe table j_final2 lines n.

perform bdc_dynpro using 'SAPMSVMA' '0100'.

perform bdc_field using 'BDC_CURSOR'

'VIMDYNFLDS-LTD_DTA_AR'.

perform bdc_field using 'BDC_OKCODE'

'=UPD'.

perform bdc_field using 'VIEWNAME'

'zfi_sl'.

perform bdc_field using 'VIMDYNFLDS-LTD_DTA_NO'

' ' .

perform bdc_field using 'VIMDYNFLDS-LTD_DTA_AR'

'X'.

perform bdc_dynpro using 'SAPLSVIX' '0210'.

perform bdc_field using 'BDC_CURSOR'

'MARK_CHECKBOX(02)'.

perform bdc_field using 'BDC_OKCODE'

'=OKAY'.

perform bdc_field using 'MARK_CHECKBOX(02)'

'X'.

loop at j_final2 into wa_final2.

v_counter = v_counter + 1.

k = v_counter - 1.

call function 'CONVERSION_EXIT_ABPSN_OUTPUT'

exporting

input = wa_final2-rzzps_posid

importing

output = v_wbs_mask.

if ( v_counter EQ 1 ).

if n EQ 1.

perform bdc_dynpro using 'SAPLSVIX' '0100'.

perform bdc_field using 'BDC_CURSOR'

'D0100_FIELD_TAB-LOWER_LIMIT (01)'.

perform bdc_field using 'BDC_OKCODE'

'=OKAY'.

perform bdc_field using 'D0100_FIELD_TAB- LOWER_LIMIT(01)'

v_wbs_mask.

exit.

else.

perform bdc_dynpro using 'SAPLSVIX' '0100'.

perform bdc_field using 'BDC_CURSOR'

'D0100_FIELD_TAB-LOWER_LIMIT(01)'.

perform bdc_field using 'BDC_OKCODE'

'=FSEL'.

perform bdc_field using 'D0100_FIELD_TAB-LOWER_LIMIT(01)'

v_wbs_mask.

perform bdc_dynpro using 'SAPLSVIX' '0200'.

perform bdc_field using 'BDC_CURSOR'

'QUERY_TAB-RELATION(01)'.

perform bdc_field using 'BDC_OKCODE'

'=ANHG'.

perform bdc_dynpro using 'SAPLSVIX' '0210'.

perform bdc_field using 'BDC_CURSOR'

'MARK_CHECKBOX(02)'.

perform bdc_field using 'BDC_OKCODE'

'=OKAY'.

perform bdc_field using 'MARK_CHECKBOX(02)'

'X'.

continue.

endif.

  • endat.

endif.

perform bdc_dynpro using 'SAPLSVIX' '0200'.

concatenate 'D0200_FIELD_TAB-BUFFER(' v_counter ')' into v_tarnbr.

perform bdc_field using 'BDC_CURSOR'

v_tarnbr.

perform bdc_field using 'BDC_OKCODE'

'=ANHG'.

concatenate 'QUERY_TAB-RELATION(' v_counter ')' into v_relation.

perform bdc_field using v_relation

'='.

perform bdc_field using v_tarnbr

v_wbs_mask.

concatenate 'QUERY_TAB-BOOL(' k ')' into v_bool.

perform bdc_field using v_bool

'OR'.

perform bdc_dynpro using 'SAPLSVIX' '0210'.

perform bdc_field using 'BDC_CURSOR'

'MARK_CHECKBOX(02)'.

perform bdc_field using 'BDC_OKCODE'

'=OKAY'.

perform bdc_field using 'MARK_CHECKBOX(02)'

'X'.

  • at last.

if ( v_counter EQ n ).

perform bdc_dynpro using 'SAPLSVIX' '0200'.

concatenate 'D0200_FIELD_TAB-BUFFER(' v_counter ')' into v_tarnbr.

perform bdc_field using 'BDC_CURSOR'

v_tarnbr.

perform bdc_field using 'BDC_OKCODE'

'=OKAY'.

concatenate 'QUERY_TAB-RELATION(' v_counter ')' into v_relation.

perform bdc_field using v_relation

'='.

perform bdc_field using v_tarnbr

v_wbs_mask.

concatenate 'QUERY_TAB-BOOL(' k ')' into v_bool.

perform bdc_field using v_bool

'OR'.

perform bdc_dynpro using 'SAPLSVIX' '0100'.

perform bdc_field using 'BDC_CURSOR'

'D0100_FIELD_TAB-LOWER_LIMIT(01)'.

perform bdc_field using 'BDC_OKCODE'

'=OKAY'.

  • endat.

endif.

endloop.

perform bdc_dynpro using 'SAPLZFI_SL' '0100'.

perform bdc_field using 'BDC_CURSOR'

'ZFI_SL-FAMENBR(01)'.

perform bdc_field using 'BDC_OKCODE'

'=SAVE'.

perform bdc_dynpro using 'SAPLZFI_SL' '0100'.

perform bdc_field using 'BDC_CURSOR'

'ZFI_SL-FAMENBR(01)'.

perform bdc_field using 'BDC_OKCODE'

'=BACK'.

perform bdc_dynpro using 'SAPMSVMA' '0100'.

perform bdc_field using 'BDC_OKCODE'

'/EBACK'.

perform bdc_field using 'BDC_CURSOR'

'VIEWNAME'.

call transaction 'SM30'

using bdcdata

mode 'A'

update 'S'

messages into messtab.

----


  • Start new screen *

----


form bdc_dynpro using program dynpro.

clear bdcdata.

bdcdata-program = program.

bdcdata-dynpro = dynpro.

bdcdata-dynbegin = 'X'.

append bdcdata.

endform.

----


  • Insert field *

----


form bdc_field using fnam fval.

if fval <> ' '.

clear bdcdata.

bdcdata-fnam = fnam.

bdcdata-fval = fval.

append bdcdata.

endif.

endform.

Actally the requirement is client dont want all the screens to be viewed they want only the last screen to be viewed where the data gets updated and they want to skip all the screens except the last screen .By using 'N' mode we cant view any of the screens and by using 'A' screen mode we can view all the screens but they dont want that. Is there any way to do that. If there is please help me in resolving the issue.

Thanks&Regards,

Ramya