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

Method declaration in Class

Former Member
0 Likes
356

Hi Experts,

In Classes and Methods i got one requirement like this , Please respond it.

I have to create the method , where class is already defined(ZCL_CONFIGURABLE_ITEM )

Create Method: IS_SEQUENCE_NOT_TO_PRINT .

Class name :ZCL_CONFIGURABLE_ITEM

They had given me example logic also. But iam not able to do this because i have no idea on classes and methods.

Please see this example and respond me .

Create Method: IS_SEQUENCE_NOT_TO_PRINT . This must be a value method in class ZCL_CONFIGURABLE_ITEM , passing document number VBDKR-VBELN that returns a parameter value: X = True, Blank = false.

GET BILLTO_PARTNER customer number for the document (reading VBPA where VBELN = document number VBDKR-VBELN and partner PARVW = ‘RE’ / ‘BP’)Read table KNA1 to get field KNA1-KATR6 where KUNNR equals Billto partner, and fields VBDKR-VKORG, VBDKR-VTWEG, VBDKR-SPART, Store first character of field KNA1-KATR6 in a work field e.g. W_ KATR6.

Add the entry below to the ZLITERAL table in all clients

Read the records from ZLITERAL table (reading key1 = C_ZLIT_GENOSYS_KEY, and key2 = C_KATR6_1) where C_KATR6_1 = attribute on class, with value = KATR6_1 . You must add this attribute on the class. Populate the internal table L_ZLITERAL_TAB type ZLITERAL_TAB_TYPE.

1 REPLY 1
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
292

Hi,

You can create the method from the CLASS BUILDER. SE24. There navigate to methods tab and enter you method name. Then select visibility public or private.

Then click on the parameters button to add parameters to the method. Selec IMPORT, EXPORT or RETURNING parameter for the function.

Regards,

Sesh