Skip to Content

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

Problem in Uploading medical data to tcode HRCLM0001 screen using BDC

Hi all..

I have implemented BDC in my program to upload staffs' medical data into screen HRCLM0001 and create batch input at tcode SM35. Unfortunately, it did not work when the staff's records in screen HRCLM0001 is more than 11 records.

I have also recorded the medical entry process for a staff that have more than 11 records using SHDB. During the recording, i have to scroll down until the last record in order to add a new line for the next record. However, how many times to click on the scroll bar depending on how many records do the staff has at that time. One more thing, the number of records for every staff varies so it is difficult to specify what line to be the new line while uploading.

Here i attached the codes, pls correct me if i am wrong and pls give me the idea or some samples to solve this. Your help is really appreciated.

  • Set the dates for retrieving records

clm_endda = sy-datum.

clm_begda = sy-datum.

clm_begda(4) = sy-datum(4) - 2.

REFRESH local_claims.

REFRESH master_tab.

line_num = 0.

lnum = 0.

scrollcount = 0.

LOOP AT it_record INTO wa_record.

Get records lock them and save them to internal table for processing

CALL FUNCTION 'HR_CLM_GET_CLAIM_RECS'

EXPORTING

pernr = wa_record-persno barea = 'MY' "BAREA

endda = clm_endda

begda = clm_begda

lock_indi = 'X'

TABLES

iclaims = local_claims. "master_tab.

*

CLEAR master_tab.

*

LOOP AT local_claims.

MOVE-CORRESPONDING local_claims TO master_tab.

APPEND master_tab.

ENDLOOP.

  • Get record count in table.

DESCRIBE TABLE master_tab LINES line_num.

  • Scroll count to add new lines depending on the records

scrollcount = line_num - 1.

  • Plus one to set to new line.

line_num = line_num + 1.

lnum = line_num.

  • Set Bdc_field

DATA : bdc_bildt(20) TYPE c,

bdc_trtyp(20) TYPE c,

bdc_bplan(20) TYPE c,

bdc_bilnr(20) TYPE c,

bdc_clamt(20) TYPE c,

bdc_dtext(50) type c,

bdc_docid(20) TYPE c.

CONCATENATE 'TABREC-BILDT(' lnum ')' INTO bdc_bildt.

CONCATENATE 'TABREC-TRTYP(' lnum ')' INTO bdc_trtyp.

CONCATENATE 'TABREC-BPLAN(' lnum ')' INTO bdc_bplan.

CONCATENATE 'TABREC-BILNR(' lnum ')' INTO bdc_bilnr.

CONCATENATE 'TABREC-CLAMT(' lnum ')' INTO bdc_clamt.

CONCATENATE 'TABREC-DTEXT(' lnum ')' INTO bdc_dtext.

CONCATENATE 'TABREC-DOCID(' lnum ')' INTO bdc_docid.

*----


PERFORM bdc_dynpro USING 'RPUCLM00' '1000'.

PERFORM bdc_field USING 'BDC_CURSOR'

'PNPPERNR-LOW'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ONLI'.

PERFORM bdc_field USING 'PNPTIMR6'

'X'.

PERFORM bdc_field USING 'PNPPERNR-LOW'

wa_record-persno. "' 120102'.

DO scrollcount TIMES.

PERFORM bdc_dynpro USING 'RPUCLM00' '2000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

ENDDO.

PERFORM bdc_dynpro USING 'RPUCLM00' '2000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=NEWL'.

PERFORM bdc_dynpro USING 'RPUCLM00' '2000'.

PERFORM bdc_field USING 'BDC_CURSOR'

bdc_bildt.

  • 'TABREC-BILDT(04)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

  • perform bdc_field using 'TABREC-BILDT(04)'

PERFORM bdc_field USING bdc_bildt

invdt_x.

PERFORM bdc_dynpro USING 'RPUCLM00' '2000'.

PERFORM bdc_field USING 'BDC_CURSOR'

bdc_trtyp.

  • 'TABREC-TRTYP(04)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=SAVE'.

PERFORM bdc_field USING bdc_bplan

  • perform bdc_field using 'TABREC-BPLAN(04)'

pa_bplan. "'MEDI'.

PERFORM bdc_field USING bdc_bilnr

pa_bilnr. "'1245'.

PERFORM bdc_field USING bdc_clamt

wa_record-bilamount.

  • ' 30.00'.

  • PERFORM bdc_field USING 'TABREC-DTEXT(02)'

PERFORM bdc_field USING bdc_dtext

wa_record-patname.

PERFORM bdc_field USING bdc_docid

pa_docid. "'A007'.

PERFORM bdc_field USING bdc_trtyp

'X'.

PERFORM bdc_dynpro USING 'RPUCLM00' '2000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=BACK'.

PERFORM bdc_dynpro USING 'RPUCLM00' '1000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/EE'.

PERFORM bdc_field USING 'BDC_CURSOR'

'PNPBEGDA'.

*perform bdc_transaction using 'HRCLM0001'.

CALL TRANSACTION 'HRCLM0001' USING bdcdata.

  • MODE 'N'

  • UPDATE 'S'.

  • MESSAGES INTO get_bdc_msg.

COMMIT WORK AND WAIT.

REFRESH bdcdata.

CLEAR bdcdata.

ENDLOOP.

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