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 for deleting a record is working fine in foreground but not in background

former_member209710
Participant
0 Kudos

Dear Expert,

I have writeen a BDC program to delete some record from Infotype 2001 ,the BDC program is working fine in foregeound but not in background.Please suggest some idea.

Thanks & Regards

Sujata.

9 REPLIES 9

Venkat_Sesha
Advisor
Advisor
0 Kudos

What is the error you are getting, What analysis you have done. ?

Former Member
0 Kudos

check the spool of the message tab crom the call transaction, may be in backgroung the BDC is expecting some screen.

raymond_giuseppi
Active Contributor
0 Kudos

Could you give more information, how did you record the sample SHDB with or without the simulate backgroud box checked, did you define dynamic actions, what is the exact behavior difference etc.

(Read : Asking Good Questions in the Forums to get Good Answers)

Regards,

Raymond

Former Member
0 Kudos

Hi,

        

     If your bdc is failing in N mode it means u having some problem in recording please check in E

     mode u can get the error screen .

Regard's

Smruti Ranjan

0 Kudos

My BDC is not giving any error message ,it is simply not deleting the data from System table.What more I have to write.

Thanks & Regards

Sujata.

0 Kudos

do you get any status message when running in foreground....
you can try to put a BDC_OKCODE as ENTR once again after the screen you get the status message...

0 Kudos

Please check these links .

http://scn.sap.com/thread/589047

http://scn.sap.com/thread/134238

Regard's

Smruti Ranjan

0 Kudos

Please check this BDC sample code .

DATA: L2001 LIKE P2001,
      DYNNR LIKE T554S-DYNNR,
      ACTIO TYPE C ,
      LNNNN LIKE PSHDR.


INFOTYPES: 2001 MODE N.


  REFRESH BDCDATA.


CASE LNNNN-INFTY.
    WHEN '2001'.                 "absences

      L2001 = PNNNN.
      PERFORM D200X USING L2001-BEGUZ
                          L2001-ENDUZ
                          DYNNR
                          ACTIO.

   WHEN OTHERS.
  ENDCASE.


================================================

FORM D200X USING BEGUZ LIKE P2001-BEGUZ
                 ENDUZ LIKE P2001-ENDUZ
                 DYNNR LIKE T554S-DYNNR
                 ACTIO TYPE C.

  IF BEGUZ CO ' 0' AND ENDUZ CO ' 0'.
    BEGUZ = SPACE06.
    ENDUZ = SPACE06.
  ENDIF.
  PERFORM BDC_ADD_DYNPRO USING 'MP200000'    DYNNR.
  CASE ACTIO.
    WHEN 'I'.
      PERFORM BDC_WRITE_FIELD USING 'P2001-BEGUZ' BEGUZ 4.
      PERFORM BDC_WRITE_FIELD USING 'P2001-ENDUZ' ENDUZ 4.
      PERFORM BDC_ADD_FIELD   USING 'BDC_OKCODE'  '=UPD'.
    WHEN 'D'.
      PERFORM BDC_ADD_FIELD   USING 'BDC_OKCODE'  '=UPDL'.
  ENDCASE.

ENDFORM.   

=======================================================================

FORM BDC_WRITE_FIELD USING FNAM FVAL FLEN.
  CLEAR BDCDATA.
  BDCDATA-FNAM = FNAM.
  WRITE FVAL TO BDCDATA-FVAL(FLEN).
  APPEND BDCDATA.
ENDFORM. 


=======================================

FORM BDC_ADD_FIELD USING FNAM
                         FVAL.

  CLEAR BDCDATA.
  BDCDATA-FNAM = FNAM.
  BDCDATA-FVAL = FVAL.
  APPEND BDCDATA.

ENDFORM.   

Regard's

Smruti Ranjan

amol_samte
Contributor
0 Kudos

Dear Sujata,

Attach the code so we people can point the bug...

Thanks,

Amol