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

How to use function module K_ORDER_SRULE_ADD?

Former Member
0 Likes
1,377

Hi,

Can you provide me the details on how to use K_ORDER_SRULE_ADD especially criteria parameter? If possible, attached wit sample code? Thanks.

Best Regards,

Chee Boon

Hi,

Can you provide me the details on how to use K_ORDER_SRULE_ADD especially criteria parameter? If possible, attached wit sample code? Thanks.

Best Regards,

Chee Boon

2 REPLIES 2
Read only

Former Member
0 Likes
942

Hi,

Try for a Where used List for this FM and see how a SAP Standard Prog using this or any Zprog might also be using this.

Try this also:

DATA: it_rules TYPE srules_ext OCCURS 0.

CALL FUNCTION 'K_SRULE_CREATE'

EXPORTING

i_objnr = caufvd_imp-objnr

EXCEPTIONS

rule_already_exists = 1

OTHERS = 2.

srules-settl_type = 'FUL'.

srules-percentage = 100.

srules-amount = 0.

srules-costcenter = caufvd_imp-kostl.

APPEND srules.

CALL FUNCTION 'K_ORDER_SRULE_ADD'

EXPORTING

object_no = caufvd_imp-objnr

TABLES

srules = srules

EXCEPTIONS

wrong_input = 1

error_occurred = 2

object_not_found = 3

activity_not_allowed = 4

OTHERS = 5.

IF sy-subrc = 0.

COMMIT WORK AND WAIT.

ENDIF.

Read only

0 Likes
942

Hi,

I did try such coding but it returned me a runtime error, mentioned criteria parameter is missing. Therefore, do you have recommendation what should i put for criteria parameter?

Besides that, can you tell what data type does caufvd_imp belong to?

Thanks.

Best Regards,

Chee Boon

Edited by: chee boon cheang on Apr 4, 2009 9:40 AM