07-19-2006 6:15 AM
Hii all,
I am working on FBCJ postings. When we post a CJ in FBCJ, the assignment field is entry field. I want this field to accept the Cash journal number automatically when it is posted. For this, I found a BADI, CJ_DOCUMENT. But as I am new to OO ABAP, I am not able to write the code. Can anyone help me out in this.
Thanks in advance.
SAA
07-19-2006 6:20 AM
Hi SAA ,
There is not need write code only in OOPs , u can put ur own ABAP code .
Regards
Prabhu
07-19-2006 6:24 AM
Hii Prabhu,
Thanks for your reply.
You need to write code in Method-Endmethod.so, OO code is required. For implementing BADI, you need to define class and in that class, method is selected and code is written there. SO, I think OO is required.
Pls input if there is any other alternative.
Thanks
SAA
07-19-2006 6:28 AM
hi abdul,
You require OO knowlege if you are going to write a code inside the method.
just look at the interface parameters of the corresponding method.
IMPORT the values and perform validation and then EXPORT it using the interface parameters.
however the knowledge of OO will be a big plus when you are touching a OO Related technology.
i would advice you to concentrate on OO ABAP.
Cheers,
Abdul Hakim
07-19-2006 6:28 AM
Hi SAA ,
Implement BADI in Se19 by using the Defination <b>CJ_DOCUMENT</b> and interface is <b>IF_EX_CJ_DOCUMENT</b>, in that interface u have only one method <b>CHANGE</b>, Double click that method it will goes to
<b>method
TCJ_CPD-Comp_code = 'PBC'.
endmethod.</b>
thats it. put a break-point and debug the report.
Regards
Prabhu
07-19-2006 7:21 AM
Hii Hakim,
Thanks a lot for your reply and advice.
Can you please give me some more input on this issue. As you said, from the method, we have to IMPORT values and then perform validation, then EXPORT. Can you explain me this in detail.
See, I have one field namely 'itcj_e_postings-alloc_nmbr' in the standard program 'SAPMFCJ0' of FBCJ Tcode. I need to assign this field with the cash journal variable. How I can do this using the IMPORT variables?
DO we need to write code as external program for this?
Pls help me.
Abdul Azeez
07-19-2006 7:27 AM
hi SAA ,
u have to put a conditin like this, bcos u are calling CHANGE Method itself, so here u can change the values.
method.
ISCJ_POSTINGS-ALLOC_NMBR = ISCJ_POSTINGS-POSTING_NUMBER.
endmethod.
but check the syntax while coding.
Regards
Prabhu
07-19-2006 7:39 AM
Thanks a lot Prabhu,
I did this. But let me know if it works simply after activation or do we need to call this method anywhere else?