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

function module

Former Member
0 Likes
442

Hi,

I am working on a function module where for all the movement types 901,902,903,904,601,602,603,604 from ZTE003_MOVEMENTS table with material number (ZCO_CSTBRK01-MATNR)having valuation class(MBEW-BKLAS) 3300 should not be updated in table ZCO_CSTBRK01.How can i write an IF condition for this?

Useful answers will be rewarded.

Regards,

Hema

2 REPLIES 2
Read only

Former Member
0 Likes
315

if ZCO_CSTBRK01-MATNR ne 3300.

insert table

endit.

explin..

if example zco_cstbrk01 = 3300

= 3300

exit from if codition.

Read only

0 Likes
315

Hi,

I have written a select query like this.

read table T_BKLAS with key MATNR = XMCMSEG-MATNR

BWTAR = XMCMSEG-BWTAR

BKLAS = XMCMSEG-BKLAS.

  • The movement types 901, 902, 601, 602 with valuation class

  • 3300 are ignored and the line item is not updated in the ZCO_CSTBRK01 table

IF ( XMCMSEG-BWART = c_901 or

XMCMSEG-BWART = c_902 or

XMCMSEG-BWART = c_903 or

XMCMSEG-BWART = c_904 or

XMCMSEG-BWART = c_601 or

XMCMSEG-BWART = c_602 or

XMCMSEG-BWART = c_603 or

XMCMSEG-BWART = c_604 )

AND t_bklas-bklas = c_3300.

CONTINUE.

SELECT * FROM ZTE003_MOVEMENTS into TABLE t_final_table

FOR ALL ENTRIES IN t_bklas WHERE matnr = t_bklas-matnr AND

bklas = c_3300.

IF SY-SUBRC <> 0.

update TABLE t_final_table.

ENDIF.

ENDIF.

Here it is giving error as 'field MATNR unknown'.

Could u pls suggest me the proper solution for this?

Regards,

Hema