‎2007 Dec 09 6:07 AM
Hi,
this is madhu,i want some help regarging BDC Call transaction method,
i am doing updated one field in the FB02 transaction code,the main requirment is
1).update the referency key field (BSEG-XREF3)
condition
in the selection screen check box(flag) is there
Populate the BSEG-XREF3 (consider the Repopulate flag). If the XREF3 field is already populated and the Repopulate flag is NO (not flagged) then DO NOT update this field.
present problem :
in the flaged condion only the field is updated but not flaged condition also the field updated.
this code i written in the program plz give me guidance
LOOP AT i_bseg INTO wa_bseg.
Get the current BSEG table value in Database for chekcing
READ TABLE i_bseg_old INTO wa_bseg_old
WITH KEY belnr = wa_bseg-belnr
bukrs = wa_bseg-bukrs
gjahr = wa_bseg-gjahr.
IF ( wa_bseg_old-xref3 IS INITIAL ) OR ( cb_repop = c_x ).
2)in the call transaction method i want to diaplay errors at the end of the report
plz give me some logic for this requirment it is very urgent plz help me
if possible plz send me to my mail id: madhu733@gmail.com
‎2007 Dec 09 7:29 AM
1) Change the condition to
IF ( wa_bseg_old-xref3 IS INITIAL ) AND ( cb_repop = c_x ). as you want to update the field only if the flag is checked and the xref3 field is not filled.
2) In call transaction you have an option to get the messages returned into an internal table
http://help.sap.com/saphelp_sm32/helpdata/en/fa/09715a543b11d1898e0000e8322d00/content.htm
The MESSAGES Parameter
The MESSAGES specification indicates that all system messages issued during a CALL TRANSACTION USING are written into the internal table <MESSTAB> . The internal table must have the structure BDCMSGCOLL .
You can record the messages issued by Transaction TFCA in table MESSTAB with the following coding:
(This example uses a flight connection that does not exist to trigger an error in the transaction.)
DATA: BEGIN OF BDCDATA OCCURS 100.
INCLUDE STRUCTURE BDCDATA.
DATA: END OF BDCDATA.
DATA: BEGIN OF MESSTAB OCCURS 10.
INCLUDE STRUCTURE BDCMSGCOLL.
DATA: END OF MESSTAB.
BDCDATA-PROGRAM = 'SAPMTFCA'.
BDCDATA-DYNPRO = '0100'.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
CLEAR BDCDATA.
BDCDATA-FNAM = 'SFLIGHT-CARRID'.
BDCDATA-FVAL = 'XX'.
APPEND BDCDATA.
BDCDATA-FNAM = 'SFLIGHT-CONNID'.
BDCDATA-FVAL = '0400'.
APPEND BDCDATA.
CALL TRANSACTION 'TFCA' USING BDCDATA MODE 'N'
MESSAGES INTO MESSTAB.
LOOP AT MESSTAB.
WRITE: / MESSTAB-TCODE,
MESSTAB-DYNAME,
MESSTAB-DYNUMB,
MESSTAB-MSGTYP,
MESSTAB-MSGSPRA,
MESSTAB-MSGID,
MESSTAB-MSGNR.
ENDLOOP.
The following figures show the return codes from CALL TRANSACTION USING and the system fields that contain message information from the called transaction. As the return code chart shows, return codes above 1000 are reserved for data transfer. If you use the MESSAGES INTO <table> option, then you do not need to query the system fields shown below; their contents are automatically written into the message table. You can loop over the message table to write out any messages that were entered into it.
Use Fm 'MESSAGE_TEXT_BUILD' to get the text based on the message variable info.