Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem with BDC - Field HRVSCHED-ENDUZ(2) IS NOT AN INPUT FIELD-urgent

hi i develped rfc bdc for course creation

through structure uploading the course schedule.problem is giving alternative days in schedule,if u know solution,pls send me,i am sending the code

schedule structure

TAGNR TAGNR NUMC 3 0 Day Number

ZBLID DZBLID CHAR 8 0 Day segment name

EVDAT CHAR10 CHAR 10 0 Character field length = 10

BEGUZ CHAR8 CHAR 8 0 Character field, 8 characters long

ENDUZ CHAR8 CHAR 8 0 Character field, 8 characters long

FUNCTION z_internal_be_last.

*"----


""Local interface:

*" IMPORTING

*" VALUE(CTU) LIKE APQI-PUTACTIVE DEFAULT 'X'

*" VALUE(MODE) LIKE APQI-PUTACTIVE DEFAULT 'N'

*" VALUE(UPDATE) LIKE APQI-PUTACTIVE DEFAULT 'L'

*" VALUE(BEGIN_DATE) LIKE HRP1000-BEGDA

*" VALUE(END_DATE) LIKE HRP1000-ENDDA

*" VALUE(BET_CODE) LIKE HRP1000-OBJID DEFAULT 50029891

*" VALUE(BET_SHORT) LIKE HRP1000-SHORT DEFAULT 'DGFIQ'

*" VALUE(BET_STEXT) LIKE HRP1000-STEXT

*" VALUE(IPRICE) LIKE BDCDATA-FVAL DEFAULT 1000

*" VALUE(ICURR) LIKE HRP1021-IWAER DEFAULT 'SGD'

*" VALUE(EPRICE) LIKE BDCDATA-FVAL DEFAULT 500

*" VALUE(ECURR) LIKE HRP1021-EWAER DEFAULT 'SGD'

*" VALUE(CAPACITY) LIKE BDCDATA-FVAL DEFAULT 99

*" VALUE(ORG_CODE) LIKE HRP1000-OBJID DEFAULT 50000391

*" VALUE(LOCATION) LIKE HRP1000-OBJID DEFAULT 50015425

*" EXPORTING

*" VALUE(SUBRC) LIKE SYST-SUBRC

*" TABLES

*" MESSTAB STRUCTURE BDCMSGCOLL OPTIONAL

*" K_SCH STRUCTURE ZSCHEDULE_NEW

*"----


DATA: temp_dt LIKE sy-datum,

tend_dt LIKE sy-datum.

subrc = 0.

temp_dt(2) = begin_date+6(2).

temp_dt2(2) = begin_date4(2).

temp_dt+4(4) = begin_date(4).

tend_dt(2) = end_date+6(2).

tend_dt2(2) = end_date4(2).

tend_dt+4(4) = end_date(4).

DATA:d_counter LIKE sy-index.

DATA:d_lines LIKE sy-index.

PERFORM bdc_dynpro USING 'SAPLRHVB' '2000'.

PERFORM zbdc_field USING 'BDC_CURSOR'

'HRVPVA-ETSRK'.

PERFORM zbdc_field USING 'BDC_OKCODE'

'=DEFI'.

PERFORM zbdc_field USING 'HRVPVA-ETSRK' bet_code.

  • ETSRK_001.

PERFORM zbdc_field USING 'HRVPVA-PEBEG' temp_dt.

  • PEBEG_002.

PERFORM zbdc_field USING 'HRVPVA-PEEND' tend_dt.

  • PEEND_003.

PERFORM bdc_dynpro USING 'SAPLRHVB' '2100'.

PERFORM zbdc_field USING 'BDC_CURSOR'

'HRVPVA-EVLOC'.

PERFORM zbdc_field USING 'BDC_OKCODE'

'=ABCR'.

PERFORM zbdc_field USING 'HRVPVA-PEBEG' temp_dt.

  • PEBEG_004.

PERFORM zbdc_field USING 'HRVPVA-PEEND' tend_dt.

  • PEEND_005.

*perform zbdc_field using 'HRVPVA-EVPLAN'

  • EVPLAN_006.

PERFORM zbdc_field USING 'HRVPVA-EVFIX' 'X'.

  • EVFIX_007.

PERFORM zbdc_field USING 'HRVPVA-EVSTEXT' bet_stext.

  • EVSTEXT_008.

PERFORM zbdc_field USING 'HRVPVA-EVSHORT' bet_short.

  • EVSHORT_009.

PERFORM zbdc_field USING 'HRVPVA-EVLOC' location.

  • EVLOC_010.

PERFORM zbdc_field USING 'HRVPVA-LANGU' 'EN'.

  • LANGU_011.

PERFORM zbdc_field USING 'HRVPVA-OPTKAP' capacity.

  • OPTKAP_012.

PERFORM zbdc_field USING 'HRVPVA-MAXKAP' capacity.

  • MAXKAP_013.

PERFORM zbdc_field USING 'HRVPVA-IPRICE' iprice.

  • IPRICE_014.

PERFORM zbdc_field USING 'HRVPVA-IWAER' icurr.

  • IWAER_015.

PERFORM zbdc_field USING 'HRVPVA-EPRICE' eprice.

  • EPRICE_016.

PERFORM zbdc_field USING 'HRVPVA-EWAER' ecurr.

  • EWAER_017.

PERFORM zbdc_field USING 'HRVPVA-OOTYP' 'O'.

  • OOTYP_018.

PERFORM zbdc_field USING 'HRVPVA-OGSRK' org_code.

  • OGSRK_019.

PERFORM bdc_dynpro USING 'SAPLRHV2' '4100'.

PERFORM zbdc_field USING 'BDC_OKCODE'

'=ABLF'.

PERFORM zbdc_field USING 'BDC_CURSOR'

'P1042-AMUST'.

PERFORM zbdc_field USING 'Q1042-NODEF' 'X'.

  • NODEF_020.

CLEAR d_counter .

MOVE 1 TO d_counter.

LOOP AT k_sch.

IF d_counter EQ 1.

PERFORM bdc_dynpro USING 'SAPLRHV2' '4100'.

PERFORM zbdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM zbdc_field USING 'BDC_CURSOR'

'PT1042-ZBLID(01)'.

PERFORM zbdc_field USING 'Q1042-NODEF' 'X'.

  • nodef_021.

PERFORM zbdc_field USING 'PT1042-TAGNR(01)'

k_sch-tagnr.

PERFORM zbdc_field USING 'PT1042-ZBLID(01)'

k_sch-zblid.

PERFORM zbdc_field USING 'BDC_OKCODE'

'LDEL'.

ENDIF.

IF d_counter NE d_lines.

PERFORM bdc_dynpro USING 'SAPLRHV2' '4100'.

PERFORM zbdc_field USING 'BDC_OKCODE'

'=NEWE'.

PERFORM zbdc_field USING 'BDC_CURSOR'

'Q1042-BGDAY'.

PERFORM zbdc_field USING 'Q1042-NODEF' 'X'.

  • NODEF_024.

PERFORM bdc_dynpro USING 'SAPLRHV2' '4100'.

PERFORM zbdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM zbdc_field USING 'BDC_CURSOR'

'PT1042-ZBLID(02)'.

PERFORM zbdc_field USING 'Q1042-NODEF' 'X'.

  • NODEF_025.

PERFORM zbdc_field USING 'PT1042-TAGNR(02)'

k_sch-tagnr.

PERFORM zbdc_field USING 'PT1042-ZBLID(02)'

k_sch-zblid.

PERFORM zbdc_field USING 'BDC_OKCODE'

'LDEL'.

ENDIF.

ADD 1 TO d_counter.

ENDLOOP.

PERFORM bdc_dynpro USING 'SAPLRHV2' '4100'.

PERFORM zbdc_field USING 'BDC_OKCODE'

'=TAKE'.

PERFORM bdc_dynpro USING 'SAPLRHVB' '2100'.

PERFORM zbdc_field USING 'BDC_CURSOR'

'HRVPVA-EVLOC'.

PERFORM zbdc_field USING 'BDC_OKCODE'

'=ABMO'.

  • CLEAR count.

  • MOVE 1 TO count.

  • LOOP AT k_sch.

  • CONCATENATE 'HRVSCHED-BEGUZ(' count ')' INTO fld_beguz.

  • CONCATENATE 'HRVSCHED-EVDAT(' count ')' INTO fld_evdat.

  • CONCATENATE 'HRVSCHED-ENDUZ(' count ')' INTO fld_enduz.

*

  • PERFORM zbdc_field USING fld_evdat k_sch-evdat.

  • PERFORM zbdc_field USING fld_beguz k_sch-beguz.

  • PERFORM zbdc_field USING fld_enduz k_sch-enduz.

  • PERFORM zbdc_field USING 'BDC_OKCODE'

  • 'LDEL'.

*

  • ADD 1 TO count.

  • ENDLOOP.

*----


CLEAR d_counter .

MOVE 1 TO d_counter.

LOOP AT k_sch.

IF d_counter EQ 1.

PERFORM bdc_dynpro USING 'SAPLRHV2' '5000'.

PERFORM zbdc_field USING 'BDC_CURSOR'

'HRVSCHED-ENDUZ(01)'.

PERFORM zbdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM zbdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM zbdc_field USING 'HRVSCHED-EVDAT(01)'

k_sch-evdat.

PERFORM zbdc_field USING 'HRVSCHED-BEGUZ(01)'

k_sch-beguz.

PERFORM zbdc_field USING 'HRVSCHED-ENDUZ(01)'

k_sch-enduz.

PERFORM zbdc_field USING 'BDC_OKCODE' "CHANGED

'FPIC'.

ENDIF.

IF d_counter NE d_lines.

PERFORM bdc_dynpro USING 'SAPLRHV2' '5000'.

PERFORM zbdc_field USING 'BDC_CURSOR'

'HRVSCHED-ENDUZ(02)'.

PERFORM zbdc_field USING 'BDC_OKCODE' "CHANGED

'AEND'.

PERFORM zbdc_field USING 'HRVSCHED-EVDAT(02)'

k_sch-evdat.

PERFORM zbdc_field USING 'HRVSCHED-BEGUZ(02)'

k_sch-beguz.

PERFORM zbdc_field USING 'HRVSCHED-ENDUZ(02)'

k_sch-enduz.

PERFORM bdc_dynpro USING 'SAPLRHV2' '5000'.

PERFORM zbdc_field USING 'BDC_CURSOR'

'HRVEVDAT-EVTEX'.

PERFORM zbdc_field USING 'BDC_OKCODE'

'=NEWL'.

ENDIF.

ADD 1 TO d_counter.

ENDLOOP.

*

*----


PERFORM bdc_dynpro USING 'SAPLRHV2' '5000'.

PERFORM zbdc_field USING 'BDC_CURSOR'

'HRVSCHED-ENDUZ(02)'.

PERFORM zbdc_field USING 'BDC_OKCODE'

'=TAKE'.

PERFORM bdc_dynpro USING 'SAPLRHVB' '2100'.

PERFORM zbdc_field USING 'BDC_CURSOR'

'HRVPVA-EVLOC'.

PERFORM zbdc_field USING 'BDC_OKCODE'

'=UPDA'.

PERFORM bdc_dynpro USING 'SAPLRHVB' '2200'.

PERFORM zbdc_field USING 'BDC_CURSOR'

'HRVPVA-PEBEG'.

PERFORM zbdc_field USING 'BDC_OKCODE'

'=TAKE'.

PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.

PERFORM zbdc_field USING 'BDC_OKCODE'

'=YES'.

PERFORM bdc_transaction TABLES messtab

USING 'PV10'

ctu

mode

update.

IF sy-subrc <> 0.

subrc = sy-subrc.

EXIT.

ENDIF.

PERFORM close_group USING ctu.

ENDFUNCTION.

Former Member
Not what you were looking for? View more on this topic or Ask a question