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

What is This Problem in Table Control ..?

Former Member
0 Likes
2,011

Look at picture .

http://menstasarim.com/Serkanresim/ads%FDz2.JPG

Only my conts value append in my control table .. other value dont came ..

Thanks for reply ..

Look at picture .

http://menstasarim.com/Serkanresim/ads%FDz2.JPG

Only my conts value append in my control table .. other value dont came ..

Thanks for reply ..

19 REPLIES 19
Read only

Former Member
0 Likes
1,984

Hi,

What code you have written for the push button EKLE....

Could you please share so that i have some more idea...

Thanks and Regards,

Anil.

Read only

former_member217544
Active Contributor
0 Likes
1,984

Hi,

Check whether any delete statement is used which deletes any duplicates records when you pressed EKLE. ( Iam not sure, but just got that thought as in the first screen shot both the records has same values ).

Regards,

Swarna Munukoti.

Read only

Former Member
0 Likes
1,984

Muhtemelen aktardığın Internal table yada variable 'ın Inıtıal olup olmadığına bakmıyorsun. Oda duplicate atıyor. Kodu yapıştırırsanız PBO PAI daha iyi olur.

Read only

0 Likes
1,984

>

> Muhtemelen aktardığın Internal table yada variable 'ın Inıtıal olup olmadığına bakmıyorsun. Oda duplicate atıyor. Kodu yapıştırırsanız PBO PAI daha iyi olur.

Could you please translate that into English for us?

English was chosen as the official SDN language as it is the most common language understood for everyone from everywhere who uses SDN.

Kind regards,

Julius

Read only

0 Likes
1,984

Look, Im newbei this forum. I dont know the all rules. But I will become careful for next writings

. Sorry again.

Regards,

Read only

0 Likes
1,984

Thanks and no problem.

Happy posting and enjoy the weekend,

Julius

Read only

Former Member
0 Likes
1,984

My Code is here ..

it_ebelp is my control table .

PAI

WHEN 'K_EKLE'.

modify it_ebelp INDEX sy-tabix .

CLEAR it2_ebelp.

it2_ebelp-evrkn = it_ebelp-evrkn.

it2_ebelp-ebeln = it_ebelp-ebeln .

it2_ebelp-ebelp = it_ebelp-ebelp .

APPEND it2_ebelp TO it_ebelp.

-


PBO

MODULE KALEM_CHANGE_FIELD_ATTR OUTPUT.

CASE SY-UCOMM.

WHEN 'K_EKLE' .

data index like sy-STEPL.

CLEAR index.

index = KALEM-lines.

LOOP AT SCREEN.

if screen-group1 = 'T2' and index = sy-STEPL .

screen-input = '1'.

endif.

modify screen.

endloop.

MOVE-CORRESPONDING it2_ebelp to it_ebelp.

modify it_ebelp INDEX sy-STEPL.

Edited by: Serkan Taskan on Aug 8, 2008 4:26 PM

Edited by: Serkan Taskan on Aug 8, 2008 4:27 PM

Read only

0 Likes
1,984

Are you Try this method clear in table. Maybe header is cause duplicates.

Clear : It2_ebeln[] , It2_ebeln.

Read only

0 Likes
1,984

Irfan Bey cevabınız için teşekkür ederim . Söylediklerinizi denedim ama olmadı Debug yaptım

modify it_ebelp INDEX sy-tabix .

kısmında hata veriyor yani int table içindekileri okumadan siliyor . Anlamadım Bir türlü

Resimdeki ilk 3 degerim sabit. Onlar normal geliyor diğerlerinde sorun var boş olarak geliyor.

it2_ebelp-evrkn = it_ebelp-evrkn.

it2_ebelp-ebeln = it_ebelp-ebeln .

it2_ebelp-ebelp = it_ebelp-ebelp . sabit değerlerimde bu alandaki değerler .

Read only

0 Likes
1,984

Gridler ile internal tabloları haberleştirmek için describe table ifadesi kullanmamışsın. sanırsam dynprodan data eksik aktarılıyor. Debug yaptığın zaman pai de tablo ne zaman boşalıyor "F5" kullanarak izlermisin ?

edit: Bir de bu ifadeyi APPEND it2_ebelp TO it_ebelp.

APPEND it2_ebelp olarak kullan tekrardan destination vermenize gerek yok.

Edited by: Irfan MATAK on Aug 8, 2008 4:50 PM

Read only

0 Likes
1,984

PAI

modify it_ebelp INDEX sy-tabix .

Tam burada boşalıyor .

F5 derledim

APPEND it2_ebelp olarak denedim hic satır acılmıyor .

Edited by: Serkan Taskan on Aug 8, 2008 4:53 PM

Read only

0 Likes
1,984

MODIFY ifadesinden önce şu şekilde bi satır eklermisin ?

DESCRIBE TABLE IT_EBELN LINES KULLANDIGINGRİD-LINES.

Read only

0 Likes
1,984

hi Serkan and Irfan,

what about using English (acc. to the Forum Rules), so everyone would understand?

thanks

ec

Read only

0 Likes
1,984

Hi My friend I understand you, Sorry , But I dont have much time . I want to detach this problem quickly.

Your right. Again sorry

Read only

0 Likes
1,984

>

> But I dont have much time . I want to detach this problem quickly. quote}

if you don't have much time, than it is even more advised to write in English, because everyone understands and you have greater chance, that someone will be able to help

Read only

Former Member
0 Likes
1,984

Hi Serkan,

Check this sample program for append....

SCREEN 100

PROCESS BEFORE OUTPUT.

MODULE STATUS_0100.

LOOP WITH CONTROL TCTRL_USERDATA.

MODULE DISPLAY_USERDATA.

ENDLOOP.

MODULE AFTER_LOOPING.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_0100.

LOOP WITH CONTROL TCTRL_USERDATA.

MODULE EXTRACT_USERDATA.

ENDLOOP.

MODULE USER_COMMAND_0100_AFTER_LOOP.

-


ZTBLDTOP

&----


*& Include ZTBLDEMO Report ZTBLDEMO *

*& *

&----


REPORT ZTBLDEMO MESSAGE-ID AT .

DATA: BEGIN OF RECORD,

NAME(30),

PHONE(20),

EMAIL(50),

END OF RECORD.

DATA: ITAB_PHONELIST LIKE RECORD OCCURS 0 WITH HEADER LINE.

CONTROLS: TCTRL_PHONELIST TYPE TABLEVIEW USING SCREEN 100.

DATA: SAVE_CODE(4),

OK_CODE(4),

FILENAME LIKE RLGRAP-FILENAME,

CONFIRMATION,

SELECTION.

-


ZTBLDEMO

&----


*& Report ZUSRDATA *

*& *

&----


*& *

*& *

&----


INCLUDE ZTBLDTOP. " global Data

  • INCLUDE ZUSRDO01. " PBO-Modules *

  • INCLUDE ZUSRDI01. " PAI-Modules *

  • INCLUDE ZUSRDF01. " FORM-Routines *

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE STATUS_0100 OUTPUT.

SET PF-STATUS 'FOR100'.

SET TITLEBAR '100'.

ENDMODULE. " STATUS_0100 OUTPUT

&----


*& Module DISPLAY_USERDATA OUTPUT

&----


  • text

----


MODULE DISPLAY_USERDATA OUTPUT.

READ TABLE ITAB_PHONELIST INDEX TCTRL_PHONELIST-CURRENT_LINE.

IF SY-SUBRC EQ 0.

RECORD-NAME = ITAB_PHONELIST-NAME.

RECORD-PHONE = ITAB_PHONELIST-PHONE.

RECORD-EMAIL = ITAB_PHONELIST-EMAIL.

ELSE.

EXIT FROM STEP-LOOP.

ENDIF.

ENDMODULE. " DISPLAY_USERDATA OUTPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE USER_COMMAND_0100 INPUT.

SAVE_CODE = OK_CODE.

CLEAR OK_CODE.

CASE SAVE_CODE.

WHEN 'BACK'.

CALL FUNCTION 'COPO_POPUP_TO_GOON'

EXPORTING

TEXTLINE1 = 'Any modifications will be lost!'

TEXTLINE2 = 'Are you sure?'

TITEL = 'Exit The Program'

IMPORTING

answer = confirmation.

if confirmation = 'G'.

LEAVE PROGRAM.

ENDIF.

WHEN 'DELE'.

CALL FUNCTION 'COPO_POPUP_TO_GOON'

EXPORTING

TEXTLINE1 = 'Selected rows will be deleted!'

TEXTLINE2 = 'Are you sure?'

TITEL = 'Delete rows'

IMPORTING

answer = confirmation.

IF CONFIRMATION = 'G'.

REFRESH ITAB_PHONELIST.

CLEAR ITAB_PHONELIST.

ENDIF.

WHEN 'SAVE'.

REFRESH ITAB_PHONELIST.

CLEAR ITAB_PHONELIST.

WHEN 'APND'.

REFRESH ITAB_PHONELIST.

CLEAR ITAB_PHONELIST.

WHEN 'READ'.

IF NOT FILENAME IS INITIAL.

CALL FUNCTION 'COPO_POPUP_TO_GOON'

EXPORTING

TEXTLINE1 = 'Any modifications will be lost!'

TEXTLINE2 = 'Are you sure?'

TITEL = 'Read Another File'

IMPORTING

answer = confirmation.

ENDIF.

if confirmation = 'G' or

FILENAME IS INITIAL.

CALL FUNCTION 'UPLOAD'

EXPORTING

FILENAME =

'c:\temp\fonelist.txt'

IMPORTING

ACT_FILENAME = FILENAME

TABLES

DATA_TAB = ITAB_PHONELIST.

ENDIF.

ENDCASE.

ENDMODULE. " USER_COMMAND_0100 INPUT

&----


*& Module EXTRACT_USERDATA INPUT

&----


  • text

----


MODULE EXTRACT_USERDATA INPUT.

CASE SAVE_CODE.

WHEN 'DELE'.

IF SELECTION IS INITIAL AND

confirmation = 'G'.

PERFORM TRANSFER.

ENDIF.

WHEN 'SAVE'.

PERFORM TRANSFER.

WHEN 'APND'.

PERFORM TRANSFER.

ENDCASE.

ENDMODULE. " EXTRACT_USERDATA INPUT

&----


*& Form TRANSFER

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM TRANSFER.

CLEAR ITAB_PHONELIST.

ITAB_PHONELIST-NAME = RECORD-NAME.

ITAB_PHONELIST-PHONE = RECORD-PHONE.

ITAB_PHONELIST-EMAIL = RECORD-EMAIL.

APPEND ITAB_PHONELIST.

ENDFORM. " TRANSFER

&----


*& Module USER_COMMAND_0100_AFTER_LOOP INPUT

&----


  • text

----


MODULE USER_COMMAND_0100_AFTER_LOOP INPUT.

CASE SAVE_CODE.

WHEN 'SAVE'.

CALL FUNCTION 'DOWNLOAD'

EXPORTING

FILENAME = FILENAME

TABLES

DATA_TAB = ITAB_PHONELIST.

WHEN 'APND'.

CLEAR ITAB_PHONELIST. " a blank row being created.

APPEND ITAB_PHONELIST. " a blank row being added.

ENDCASE.

ENDMODULE. " USER_COMMAND_0100_AFTER_LOOP INPUT

Mohinder

Read only

Former Member
0 Likes
1,984

Sorry Everbody ..

I write English after that ..

Problem is dont append row in my control table .

Control Table is name IT_EBELP .

IT2_EBELP is like IT_EBELP .

PAI

modify it_ebelp INDEX sy-tabix . error is here

dont append in my control and delete value of my control table

only append my const value

CLEAR it2_ebelp.

it2_ebelp-evrkn = it_ebelp-evrkn. "1 CONST VALUE

it2_ebelp-ebeln = it_ebelp-ebeln . "2 CONST VALUE

it2_ebelp-ebelp = it_ebelp-ebelp . "3 CONST VALUE

APPEND it2_ebelp to it_ebelp .

Read only

0 Likes
1,984

You have to read the record with key and if you don't find that record than append a new record otherwise modify it.

In PAI, MODULE in the LOOP of table control, you should code like this:


read table it_ebelp into la_ebelp with key evrkn = it_ebelp-everkn
ebeln = it_ebelp-ebeln
ebelp = it_ebelp-ebelp.
if sy-subrc = 0.
  modify it_ebelp.
else.
APPEND it_ebelp.
endif.

Regards,

Naimesh Patel

Read only

0 Likes
1,984

Thanks For Reply .

I append 😃 in the end . Problem is Read .. I forget to read Table .