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

Problem in XD01 : Ok-Code '=NP' is not working

Former Member
0 Likes
759

Hi,

I am writing BDC for XD01 and XK01.

In XK01, OK-Code '=NP' is working fine for getting the new line in a table control.

But in XD01,

In one of the tab name Contact Person, I need to enter variable number of entries in table control (less than 13, in any case), Ok-Code = 'NP' is not working here.

It does not save all the lines.It saves first line and the starts over-writting the second line.In this way, only first and last lines are saved.

LOOP AT i_item WHERE number = i_head-number.

linecount = linecount + 1.

IF linecount = 1.

perform bdc_dynpro using 'SAPMF02D' '0360'.

perform bdc_field using 'BDC_CURSOR'

'KNVK-PAFKT(01)'.

perform bdc_field using 'KNVK-NAMEV(01)'

i_item-NAMEV.

perform bdc_field using 'KNVK-NAME1(01)'

i_item-NAME5.

perform bdc_field using 'KNVK-ABTNR(01)'

i_item-ABTNR.

perform bdc_field using 'KNVK-PAFKT(01)'

i_item-PAFKT.

else.

perform bdc_dynpro using 'SAPMF02D' '0360'.

perform bdc_field using 'BDC_CURSOR'

'KNVK-PAFKT(02)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=NP'.

perform bdc_field using 'KNVK-NAMEV(02)'

i_item-NAMEV.

perform bdc_field using 'KNVK-NAME1(02)'

i_item-NAME5.

perform bdc_field using 'KNVK-ABTNR(02)'

i_item-ABTNR.

perform bdc_field using 'KNVK-PAFKT(02)'

i_item-PAFKT.

endif.

AT END OF number.

perform bdc_dynpro using 'SAPMF02D' '0360'.

perform bdc_field using 'BDC_OKCODE'

'=VW'.

Can anyone tell me, what can be the reason for it.

Regards,

Priyanka.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
539

Hi priyanka,

try using okcode = LINS

Hi,

I am writing BDC for XD01 and XK01.

In XK01, OK-Code '=NP' is working fine for getting the new line in a table control.

But in XD01,

In one of the tab name Contact Person, I need to enter variable number of entries in table control (less than 13, in any case), Ok-Code = 'NP' is not working here.

It does not save all the lines.It saves first line and the starts over-writting the second line.In this way, only first and last lines are saved.

LOOP AT i_item WHERE number = i_head-number.

linecount = linecount + 1.

IF linecount = 1.

perform bdc_dynpro using 'SAPMF02D' '0360'.

perform bdc_field using 'BDC_CURSOR'

'KNVK-PAFKT(01)'.

perform bdc_field using 'KNVK-NAMEV(01)'

i_item-NAMEV.

perform bdc_field using 'KNVK-NAME1(01)'

i_item-NAME5.

perform bdc_field using 'KNVK-ABTNR(01)'

i_item-ABTNR.

perform bdc_field using 'KNVK-PAFKT(01)'

i_item-PAFKT.

else.

perform bdc_dynpro using 'SAPMF02D' '0360'.

perform bdc_field using 'BDC_CURSOR'

'KNVK-PAFKT(02)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=NP'.

perform bdc_field using 'KNVK-NAMEV(02)'

i_item-NAMEV.

perform bdc_field using 'KNVK-NAME1(02)'

i_item-NAME5.

perform bdc_field using 'KNVK-ABTNR(02)'

i_item-ABTNR.

perform bdc_field using 'KNVK-PAFKT(02)'

i_item-PAFKT.

endif.

AT END OF number.

perform bdc_dynpro using 'SAPMF02D' '0360'.

perform bdc_field using 'BDC_OKCODE'

'=VW'.

Can anyone tell me, what can be the reason for it.

Regards,

Priyanka.

2 REPLIES 2
Read only

Former Member
0 Likes
540

Hi priyanka,

try using okcode = LINS

Read only

0 Likes
539

Hi,

It worked.

Thanks a lot for your help.

Regards,

Priyanka.