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: 

CJ20N - Validation on fields in

Former Member
0 Kudos

Hi everyone,

I need to make the following date fields MANDATORY in cj20n:

Basic Start

Basic Fin

( in dates tab WBS )

does anyone know how to do this ?

I tried to check these fields in method

IF_EX_WORKBREAKDOWN_UPDATE~AT_SAVE

but I don't know how to access the values.

Any help would be greatly appreciated,

Ofer

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

I think there's quite a number of modification required.

The type group CJBAI (can be seen via SE11) called by this modification does not contain the basic start and end dates. I think you need to modify this type group or create a new one to be referenced.

Use SE19 to create a 'z' class type, definition WORKBREAKDOWN_UPDATE. then at the method AT_SAVE and put in the check.

Hope this helps.

Cheers,

Gim

5 REPLIES 5

Former Member
0 Kudos

Hi,

I think there's quite a number of modification required.

The type group CJBAI (can be seen via SE11) called by this modification does not contain the basic start and end dates. I think you need to modify this type group or create a new one to be referenced.

Use SE19 to create a 'z' class type, definition WORKBREAKDOWN_UPDATE. then at the method AT_SAVE and put in the check.

Hope this helps.

Cheers,

Gim

0 Kudos

Hi ,

Thanks for the helpful answer.

Actually meanwhile we have solved the problem using the code below ( getting the value of the variable from the calling program ).

But your solution seems more suitable.

Do you mean I should append a fields to table PRPS ?

how should it be named and populated ?

Regards

Ofer

data: name_pstrt(40) value '(SAPLCJTR)PRTE',

ps_pstrt type PRTE.

field-symbols: <fs_pstrt> type any.

data: catch1 type ref to cx_sy_assign_cast_illegal_cast,

catch2 type ref to cx_sy_assign_cast_unknown_type,

catch3 type ref to cx_sy_assign_out_of_range.

try.

assign (name_pstrt) to <fs_pstrt>.

catch cx_sy_assign_cast_illegal_cast into catch1.

catch cx_sy_assign_cast_unknown_type into catch2.

catch cx_sy_assign_out_of_range into catch3.

endtry.

check sy-subrc = 0.

ps_pstrt = <fs_pstrt>.

IF ( ps_pstrt-pstrt is INITIAL

or ps_pstrt-estrt is INITIAL )

... error message ...

endif.

0 Kudos

Hi,

To be frank I was working on about the same thing (mine is checking the settlement rule structure and content that user enters on screen) and just managed to overcome my problem today.

You do not have to modify any tables or class types at all after all.

In the ~AT_SAVE coding, you can call up function CJDT_PRTE_GET and check the content of the date. If it is initial then call up an error message.

If you need to get all the function modules that's called at that screen, take a look at the function group CJTR (via SE80).

Hope this helps.

Cheers,

Gimmo

0 Kudos

HI,

the method (IF_EX_WORKBREAKDOWN_UPDATE~AT_SAVE) have parameters IT_WBS_ELEMENT, IT_WBS_HIERARCHY, ERROR_WITH_MESSAGE.

U will get values in IT_WBS_ELEMENT internal table.

as below exp code u can access values.

DATA: wa_prps like LINE OF it_wbs_element.

CLEAR wa_prps.

LOOP AT IT_WBS_ELEMENT INTO wa_prps.

IF ( wa_prps-stufe = 1 OR wa_prps-stufe = 2 )

AND ( wa_prps-plakz = 'X' OR wa_prps-belkz = 'X' ).

message e001(ZPS_MSG) with wa_prps-POSID wa_prps-stufe.

ENDIF.

ENDLOOP.

U can validate the data as per ur requirments.

Regards

Gupta........

Former Member
0 Kudos

Hi Gimmo,

The FM CJDT_PRTE_GET actually did the work.

Although only at WBS level (not project level)

But it satisfies the requirement.

Cheers,

Ofer