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: 

Badi create contract

former_member626380
Participant
611

Hi

I used badi create contract

Badi_re_cn_cn

To get contract number to use it for case but

The contract number show empty like below why?

1 ACCEPTED SOLUTION

MateuszAdamus
Active Contributor
0 Kudos
404

Hello alaa-azazy

I assume you're using the GET_NUMBER method of the BAdI. This method is for a custom logic to assign a new number to the Contract, not to get the Contract's number.

You can try using method AFTER_STORE with the code shown below. Just a note, the code was not tested.

DATA:
  lo_contract TYPE REF TO if_recn_contract.

lo_contract ?= io_object.
DATA(ls_detail) = lo_contract->get_detail( ).

ls_detail-bukrs <-- Company Code
ls_detail-recnnr <-- Contract's number
Kind regards,
Mateusz
6 REPLIES 6

MateuszAdamus
Active Contributor
0 Kudos
404

Hi alaa-azazy

Do you mean BAdI or BAPI? What is the name of the function/class you use?

How do you use it - please show your invocation, otherwise it's guessing.


Kind regards,
Mateusz

former_member626380
Participant
0 Kudos
404

Hi mateusz

I want send email message after save document so I decided use badi when save to send email have a number of document

MateuszAdamus
Active Contributor
0 Kudos
405

Hello alaa-azazy

I assume you're using the GET_NUMBER method of the BAdI. This method is for a custom logic to assign a new number to the Contract, not to get the Contract's number.

You can try using method AFTER_STORE with the code shown below. Just a note, the code was not tested.

DATA:
  lo_contract TYPE REF TO if_recn_contract.

lo_contract ?= io_object.
DATA(ls_detail) = lo_contract->get_detail( ).

ls_detail-bukrs <-- Company Code
ls_detail-recnnr <-- Contract's number
Kind regards,
Mateusz

0 Kudos
404

There aren't get so all not have return

0 Kudos
404

I'm sorry, but I don't understand what you're trying to say. Can you please explain again?


Kind regards,
Mateusz

0 Kudos
404

I showed you how to get the Contract's number. Email sending logic can be found on the INternet. Just use Google.

Kind regards,
Mateusz