Application Development and Automation 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: 
Read only

Clarifications on an ABAP objects code

Former Member
0 Likes
676

Hi Experts,

I found this code and i am trying to understand its logic:

DATA: l_s_source_kyf TYPE rslbct_tg_stock_kyf,

           l_s_target_kyf TYPE /rtf/_s_kyf.

     MOVE-CORRESPONDING SOURCE_FIELDS TO l_s_source_kyf.

     l_s_target_kyf-fieldnm =

       if_rslbct_kyf_transform_con=>c_kyf_iss_ein_qua.

    CALL METHOD (g_clnam)=>stock_adjust

       EXPORTING

         iv_s_source_kyf = l_s_source_kyf

       CHANGING

         cv_s_target_kyf = l_s_target_kyf.

     RESULT = l_s_target_kyf-value_qua.

I have a question on this line:

    CALL METHOD (g_clnam)=>stock_adjust

I understood that the system is calling the method g_clnam, but i don't understand the

=>stock_adjust

Could someone explain me please?

Thanks.

Amine

1 ACCEPTED SOLUTION
Read only

former_member194152
Contributor
0 Likes
629

i Believe stock_adjust is the name of static method available in class varriable (g_clnam), the class name can be identified only at runtime.

3 REPLIES 3
Read only

former_member194152
Contributor
0 Likes
630

i Believe stock_adjust is the name of static method available in class varriable (g_clnam), the class name can be identified only at runtime.

Read only

0 Likes
629

g_clnam contains the name of the class for which method is implemented. since you are using => symbol that means trying to call the class method ( stock_adjust) you need to give the class name as well. Therfore

CALL METHOD (g_clnam)=>stock_adjust  means that g_clnam is the class which is calling the class method stock_adjust.

Thanks & Regards

Ajit Chirania

Read only

Former Member
0 Likes
629

Thaanks to both of you for your valuable answers.

Amine