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 Screen Change.

Former Member
0 Kudos

Hi,

I have a Bdc program, I am sending my code. I just wants material and plant in selectin scree. I donot want

create session, call transaction, Nodata Indicator and SMALLLOG. I want to pass processing mode as 'A', Update Mode as 'S' and Nodata Indicator as '/'.

Please help me doing this.

Thanks

neelu.

report ZMM_3030_SOURCE_LIST_LOAD

no standard page heading line-size 255.

include bdcrecx1.

tables: eina, eine, eord.

DATA: BEGIN OF it_eord OCCURS 0,

matnr LIKE eord-matnr,

werks LIKE eord-werks,

vdatu LIKE eord-vdatu,

  • bdatu LIKE eord-bdatu,

lifnr LIKE eord-lifnr,

  • ekorg LIKE eord-ekorg,

  • flifn LIKE eord-flifn,

  • autet LIKE eord-autet,

END OF it_eord.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS: s_matnr for eina-matnr.

parameters: p_werks like eine-werks.

SELECTION-SCREEN END OF BLOCK b1.

start-of-selection.

PERFORM get_sourcelist_data.

DATA: l_vdatu like sy-datum.

LOOP AT it_eord.

PERFORM bdc_dynpro USING 'SAPLMEOR' '0200'.

PERFORM bdc_field USING 'BDC_CURSOR' 'EORD-MATNR'.

PERFORM bdc_field USING 'BDC_OKCODE' '/00'.

PERFORM bdc_field USING 'EORD-MATNR' it_eord-matnr.

PERFORM bdc_field USING 'EORD-WERKS' '3030'.

PERFORM bdc_dynpro USING 'SAPLMEOR' '0205'.

PERFORM bdc_field USING 'BDC_CURSOR' 'EORD-AUTET(01)'.

PERFORM bdc_field USING 'BDC_OKCODE' '=BU'.

perform sub_format_date using it_eord-vdatu changing l_vdatu.

PERFORM bdc_field USING 'EORD-VDATU(01)' l_vdatu.

PERFORM bdc_field USING 'EORD-BDATU(01)' '12319999'.

PERFORM bdc_field USING 'EORD-LIFNR(01)' it_eord-lifnr.

PERFORM bdc_field USING 'EORD-EKORG(01)' '9000'.

PERFORM bdc_field USING 'RM06W-FESKZ(01)' 'X'.

PERFORM bdc_field USING 'EORD-AUTET(01)' '1'.

PERFORM bdc_transaction USING 'ME01'.

ENDLOOP.

&----


*& Form get_sourcelist_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM get_sourcelist_data .

SELECT matnr

werks

vdatu

  • bdatu

lifnr

  • ekorg

  • flifn

  • autet

FROM eord

INTO CORRESPONDING FIELDS OF TABLE it_eord

WHERE werks = p_werks

AND matnr in s_matnr.

ENDFORM. " get_purchlist_data

*&----


*

*& Form sub_format_date

*&----


*

form sub_format_date using p_date_in changing p_date_out.

data: l_datfm like usr01-datfm, l_day(2), l_month(2), l_year(4).

l_year = p_date_in(4).

l_month = p_date_in+4(2).

l_day = p_date_in+6(2).

select single datfm from usr01 into l_datfm

where bname = sy-uname.

  • case l_datfm.

  • when '1'. "DDMMYYYY

  • concatenate l_day l_month l_year into p_date_out.

  • when '2' or '3'. "MMDDYYYY

concatenate l_month l_day l_year into p_date_out.

  • when '4' or '5' or '6'. "YYYYMMDD

  • concatenate l_year l_month l_day into p_date_out.

  • endcase.

endform. " sub_format_date

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi neelu,

To display only Material and Plant in your selection screen, you have to make some changes in your <b>INCLUDE BDCRECX1</b>Program

I have given a sample code and you can check that.You have to remove some codes in your Include program.

-


*

  • data definition

----


  • Batchinputdata of single transaction

data: bdcdata like bdcdata occurs 0 with header line.

  • messages of call transaction

data: messtab like bdcmsgcoll occurs 0 with header line.

  • error session opened (' ' or 'X')

data: e_group_opened.

  • message texts

tables: t100.

data: flag type i.

data:session value ' '.

data: ctu value 'X'.

data: group(12).

data: ctumode like ctu_params-dismode value 'N'.

data: user like sy-uname.

data:cupdate like ctu_params-updmode value 'L'.

data: keep value ' '.

data:e_group(12).

data:holddate like sy-datum.

data:e_user like sy-uname.

data:e_keep .

data:e_hdate like sy-datum.

data:nodata value '/'.

data:smalllog value ' '.

move sy-uname to e_user.

move sy-uname to user.

----


  • open dataset *

----


form open_dataset using p_dataset.

open dataset p_dataset in text mode.

if sy-subrc <> 0.

write: / text-e00, sy-subrc.

stop.

endif.

endform.

----


  • close dataset *

----


form close_dataset using p_dataset.

close dataset p_dataset.

endform.

----


  • create batchinput session *

  • (not for call transaction using...) *

----


form open_group.

endform.

----


  • end batchinput session *

  • (call transaction using...: error session) *

----


form close_group.

if session = 'X'.

  • close batchinput group

call function 'BDC_CLOSE_GROUP'.

write: /(30) 'BDC_CLOSE_GROUP'(i04),

(12) 'returncode:'(i05),

sy-subrc.

else.

if e_group_opened = 'X'.

call function 'BDC_CLOSE_GROUP'.

write: /.

write: /(30) 'Fehlermappe wurde erzeugt'(i06).

endif.

endif.

endform.

----


  • Start new transaction according to parameters *

----


form bdc_transaction using tcode.

data: l_mstring(480).

data: l_subrc like sy-subrc.

  • batch input session

if session = 'X'.

call function 'BDC_INSERT'

exporting

tcode = tcode

tables

dynprotab = bdcdata.

if smalllog <> 'X'.

write: / 'BDC_INSERT'(i03),

tcode,

'returncode:'(i05),

sy-subrc,

'RECORD:',

sy-index.

endif.

  • call transaction using

else.

refresh messtab.

call transaction tcode using bdcdata

mode ctumode

update cupdate

messages into messtab.

l_subrc = sy-subrc.

loop at messtab.

select single * from t100 where sprsl = messtab-msgspra

and arbgb = messtab-msgid

and msgnr = messtab-msgnr.

if sy-subrc = 0.

l_mstring = t100-text.

if l_mstring cs '&1'.

replace '&1' with messtab-msgv1 into l_mstring.

replace '&2' with messtab-msgv2 into l_mstring.

replace '&3' with messtab-msgv3 into l_mstring.

replace '&4' with messtab-msgv4 into l_mstring.

else.

replace '&' with messtab-msgv1 into l_mstring.

replace '&' with messtab-msgv2 into l_mstring.

replace '&' with messtab-msgv3 into l_mstring.

replace '&' with messtab-msgv4 into l_mstring.

endif.

condense l_mstring.

if messtab-msgtyp = 'S'.

flag = 1.

else.

flag = 2.

endif.

move l_mstring to work_final-message.

endif.

endloop.

endif.

    • Erzeugen fehlermappe ************************************************

if l_subrc <> 0 and e_group <> space.

if e_group_opened = ' '.

call function 'BDC_OPEN_GROUP'

exporting

client = sy-mandt

group = e_group

user = e_user

keep = e_keep

holddate = e_hdate.

e_group_opened = 'X'.

endif.

call function 'BDC_INSERT'

exporting

tcode = tcode

tables

dynprotab = bdcdata.

endif.

  • ENDIF.

refresh bdcdata.

endform.

----


  • 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 <> nodata.

clear bdcdata.

bdcdata-fnam = fnam.

bdcdata-fval = fval.

append bdcdata.

endif.

endform.

I think you can understand it.

Regards,

Ruthra

2 REPLIES 2

Former Member
0 Kudos

Hi neelu,

To display only Material and Plant in your selection screen, you have to make some changes in your <b>INCLUDE BDCRECX1</b>Program

I have given a sample code and you can check that.You have to remove some codes in your Include program.

-


*

  • data definition

----


  • Batchinputdata of single transaction

data: bdcdata like bdcdata occurs 0 with header line.

  • messages of call transaction

data: messtab like bdcmsgcoll occurs 0 with header line.

  • error session opened (' ' or 'X')

data: e_group_opened.

  • message texts

tables: t100.

data: flag type i.

data:session value ' '.

data: ctu value 'X'.

data: group(12).

data: ctumode like ctu_params-dismode value 'N'.

data: user like sy-uname.

data:cupdate like ctu_params-updmode value 'L'.

data: keep value ' '.

data:e_group(12).

data:holddate like sy-datum.

data:e_user like sy-uname.

data:e_keep .

data:e_hdate like sy-datum.

data:nodata value '/'.

data:smalllog value ' '.

move sy-uname to e_user.

move sy-uname to user.

----


  • open dataset *

----


form open_dataset using p_dataset.

open dataset p_dataset in text mode.

if sy-subrc <> 0.

write: / text-e00, sy-subrc.

stop.

endif.

endform.

----


  • close dataset *

----


form close_dataset using p_dataset.

close dataset p_dataset.

endform.

----


  • create batchinput session *

  • (not for call transaction using...) *

----


form open_group.

endform.

----


  • end batchinput session *

  • (call transaction using...: error session) *

----


form close_group.

if session = 'X'.

  • close batchinput group

call function 'BDC_CLOSE_GROUP'.

write: /(30) 'BDC_CLOSE_GROUP'(i04),

(12) 'returncode:'(i05),

sy-subrc.

else.

if e_group_opened = 'X'.

call function 'BDC_CLOSE_GROUP'.

write: /.

write: /(30) 'Fehlermappe wurde erzeugt'(i06).

endif.

endif.

endform.

----


  • Start new transaction according to parameters *

----


form bdc_transaction using tcode.

data: l_mstring(480).

data: l_subrc like sy-subrc.

  • batch input session

if session = 'X'.

call function 'BDC_INSERT'

exporting

tcode = tcode

tables

dynprotab = bdcdata.

if smalllog <> 'X'.

write: / 'BDC_INSERT'(i03),

tcode,

'returncode:'(i05),

sy-subrc,

'RECORD:',

sy-index.

endif.

  • call transaction using

else.

refresh messtab.

call transaction tcode using bdcdata

mode ctumode

update cupdate

messages into messtab.

l_subrc = sy-subrc.

loop at messtab.

select single * from t100 where sprsl = messtab-msgspra

and arbgb = messtab-msgid

and msgnr = messtab-msgnr.

if sy-subrc = 0.

l_mstring = t100-text.

if l_mstring cs '&1'.

replace '&1' with messtab-msgv1 into l_mstring.

replace '&2' with messtab-msgv2 into l_mstring.

replace '&3' with messtab-msgv3 into l_mstring.

replace '&4' with messtab-msgv4 into l_mstring.

else.

replace '&' with messtab-msgv1 into l_mstring.

replace '&' with messtab-msgv2 into l_mstring.

replace '&' with messtab-msgv3 into l_mstring.

replace '&' with messtab-msgv4 into l_mstring.

endif.

condense l_mstring.

if messtab-msgtyp = 'S'.

flag = 1.

else.

flag = 2.

endif.

move l_mstring to work_final-message.

endif.

endloop.

endif.

    • Erzeugen fehlermappe ************************************************

if l_subrc <> 0 and e_group <> space.

if e_group_opened = ' '.

call function 'BDC_OPEN_GROUP'

exporting

client = sy-mandt

group = e_group

user = e_user

keep = e_keep

holddate = e_hdate.

e_group_opened = 'X'.

endif.

call function 'BDC_INSERT'

exporting

tcode = tcode

tables

dynprotab = bdcdata.

endif.

  • ENDIF.

refresh bdcdata.

endform.

----


  • 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 <> nodata.

clear bdcdata.

bdcdata-fnam = fnam.

bdcdata-fval = fval.

append bdcdata.

endif.

endform.

I think you can understand it.

Regards,

Ruthra

andreas_mann3
Active Contributor
0 Kudos

Hi,

you choosed "create program" after recording Batch input with TA SHDB

when you choose <b>create function module</b> , you 've no

additional select-options and paramters

when fm finished you can integrate fm in your program

regards Andreas