‎2008 Aug 22 9:51 AM
Hi All,
I am developing a report progrm to Post Open Purchase Orders. To do so i am using BAPI_ACC_DOCUMENT_POST,
after a PO is posted successfully, i have to call t-code FB08 and pass the document number to it. I am using BDC call transaction to call FB08 t-code.
The t-code FB08 creates reversal document number of the document number being passed to it.
My requirement is to capture this reversal document number and display it in the output.
Now my doubts is
1) Hw to capture reversal document number?
regards
balu
‎2008 Aug 22 10:20 AM
‎2008 Aug 22 9:54 AM
Hi ,
are u using BDCMSGCOLL to capture msgs , it will have that rev.doc. no.
sytax---> call transaction 'XXXX' message into BDCMSGCOLL.
Regards
prabhu
‎2008 Aug 22 9:54 AM
‎2008 Aug 22 9:57 AM
Actually i havent written BDC prgm yet.
Please let me know wt steps needs to be followed to achieve my functionality.
‎2008 Aug 22 10:00 AM
Actually what u want....U need BDC r reversal document number....
What purpose u r doing in BDC
Ex: Vendor payment upload,customer payment upload,Gl
‎2008 Aug 22 10:08 AM
From BDC i'm calling FB08 t-code and passing an document num to it.
Then FB08 t-code creates reversal doc num for the doc num which i have passed .
I need to capture reversal doc num created by fb08.
for ex.
if 1000 is the doc num passed to fb08 tcode from BDC prgm,
and if 2000 is the reversal doc num created by FB08.
i need to capture 2000.
‎2008 Aug 22 10:18 AM
Refer this code...
Once you collect all the valid reversal document number and use a select on it. Read the itab only when it is found.
LOOP AT IT_MESSAGES INTO WA_MESSAGES.
IF WA_MESSAGES-MSGTYP = 'E'.
WA_LOG-MSGTYP = WA_MESSAGES-MSGTYP .
W_MSGNO = WA_MESSAGES-MSGNR.
W_MSGV1 = WA_MESSAGES-MSGV1.
W_MSGV2 = WA_MESSAGES-MSGV2.
W_MSGV3 = WA_MESSAGES-MSGV3.
W_MSGV4 = WA_MESSAGES-MSGV4.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = WA_MESSAGES-MSGID
NO = W_MSGNO
V1 = W_MSGV1
V2 = W_MSGV2
V3 = W_MSGV3
V4 = W_MSGV4
IMPORTING
MSG = WA_LOG-MESSAGE
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
APPEND WA_LOG TO IT_LOG .
CLEAR WA_LOG.
ELSE.
IF WA_MESSAGES-MSGTYP = C_S AND
WA_MESSAGES-MSGID = C_MSGID AND
WA_MESSAGES-MSGNR = C_MSGNR.
W_ADJDOC = WA_MESSAGES-MSGV1+0(10).
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = W_ADJDOC
IMPORTING
OUTPUT = W_ADJDOC.
*Get Adjustment Document no,posting date,entry date and entry time
SELECT BELNR BUDAT
CPUDT CPUTM
INTO CORRESPONDING FIELDS OF TABLE IT_ADJ
FROM BKPF
WHERE BUKRS IN S_BUKRS
AND GJAHR = P_GJAHR
AND BELNR EQ W_ADJDOC
AND BLART = C_AL.
IF SY-SUBRC = 0.
READ TABLE IT_ADJ INTO WA_ADJ WITH KEY
BELNR = W_ADJDOC.
IF SY-SUBRC = 0.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = WA_ADJ-BELNR
IMPORTING
OUTPUT = WA_ADJ-BELNR.
WA_ALVOUT-BELNR1 = WA_ADJ-BELNR. "Adjustment Doc No.
WA_ALVOUT-BUDAT1 = WA_ADJ-BUDAT. "Adjustment Posting date
WA_ALVOUT-CPUDT1 = WA_ADJ-CPUDT. "Adjustment entry date
WA_ALVOUT-CPUTM1 = WA_ADJ-CPUTM. "Adjustment entry time
APPEND WA_ALVOUT TO IT_ALVOUT.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM. " BDC_POSTING
Thanks and Regards
Guru
‎2008 Aug 22 10:54 AM
‎2008 Aug 22 9:55 AM
Hi,
Declare and internal and collect the reersal document number and then loop at itab to display it.
Regrads
Guru
‎2008 Aug 22 10:03 AM
if internal table has to be declared,wt fields should the internal table contain?
The reversal doc num is of the type BELNR.
‎2008 Aug 22 9:57 AM
Hi,
U can get the reverse document or line item display.
Example:
Suppose ur document no Vendor means it will displayed in FBL1N
Costomer mean:FBL3N
There u find ur reverse document number.
Regards:
Prabu
‎2008 Aug 22 10:20 AM
‎2008 Sep 05 11:28 AM