Fill a table with value

Die Frage ist als "gelöst" markiert. Den entsprechend Beitrag findest du hier.

Getting started ... Alles für einen gelungenen Start.
6 Beiträge • Seite 1 von 1
6 Beiträge Seite 1 von 1

Fill a table with value

Beitrag von cgreiner (ForumUser / 17 / 2 / 0 ) »
i search a solution to build a internal table with value.
I have read many books and any Internet Forum, but in result, it will not work.
Who can help?

TYPES: BEGIN OF t_struct1,
jahr(4) TYPE n,
j(2) TYPE n,
tab1 TYPE p decimals 3,
tab2(4) type n,
tab3(3) type n,
END OF t_struct1,
t_itab1n TYPE STANDARD TABLE OF t_struct1.
DATA itab1n type t_itab1n.

itab1n = VALUE #( ( jahr = '2005' j = '01' tab1 = '0.400' tab2 = '3000' tab3 = '900' )
( jahr = '2006' j = '02' tab1 = '0.384' tab2 = '2880' tab3 = '864' )
( jahr = '2007' j = '03' tab1 = '0.368' tab2 = '2760' tab3 = '828' )
( jahr = '2008' j = '04' tab1 = '0.352' tab2 = '2640' tab3 = '792' )
( jahr = '2009' j = '05' tab1 = '0.336' tab2 = '2520' tab3 = '756' )
( jahr = '2010' j = '06' tab1 = '0.320' tab2 = '2400' tab3 = '720' )
( jahr = '2011' j = '07' tab1 = '0.304' tab2 = '2280' tab3 = '684' )
( jahr = '2012' j = '08' tab1 = '0.288' tab2 = '2160' tab3 = '648' )
( jahr = '2013' j = '09' tab1 = '0.272' tab2 = '2040' tab3 = '612' )
( jahr = '2014' j = '10' tab1 = '0.256' tab2 = '1920' tab3 = '576' )
( jahr = '2015' j = '11' tab1 = '0.240' tab2 = '1800' tab3 = '540' )
( jahr = '2016' j = '12' tab1 = '0.224' tab2 = '1680' tab3 = '504' )
( jahr = '2017' j = '13' tab1 = '0.208' tab2 = '1560' tab3 = '468' )
( jahr = '2018' j = '14' tab1 = '0.192' tab2 = '1440' tab3 = '432' )
( jahr = '2019' j = '15' tab1 = '0.176' tab2 = '1320' tab3 = '396' )
( jahr = '2020' j = '16' tab1 = '0.160' tab2 = '1200' tab3 = '360' )
( jahr = '2021' j = '17' tab1 = '0.152' tab2 = '1140' tab3 = '342' )
( jahr = '2022' j = '18' tab1 = '0.144' tab2 = '1080' tab3 = '324' )
( jahr = '2023' j = '19' tab1 = '0.136' tab2 = '1020' tab3 = '306' )
( jahr = '2024' j = '20' tab1 = '0.128' tab2 = '0960' tab3 = '288' )
( jahr = '2025' j = '21' tab1 = '0.120' tab2 = '0900' tab3 = '270' )
( jahr = '2026' j = '22' tab1 = '0.112' tab2 = '0840' tab3 = '252' )
( jahr = '2027' j = '23' tab1 = '0.104' tab2 = '0780' tab3 = '234' )
( jahr = '2028' j = '24' tab1 = '0.096' tab2 = '0720' tab3 = '216' )
( jahr = '2029' j = '25' tab1 = '0.088' tab2 = '0660' tab3 = '198' )
( jahr = '2030' j = '26' tab1 = '0.080' tab2 = '0600' tab3 = '180' )
( jahr = '2031' j = '27' tab1 = '0.072' tab2 = '0540' tab3 = '162' )
( jahr = '2032' j = '28' tab1 = '0.064' tab2 = '0480' tab3 = '144' )
( jahr = '2033' j = '29' tab1 = '0.056' tab2 = '0420' tab3 = '126' )
( jahr = '2034' j = '30' tab1 = '0.048' tab2 = '0360' tab3 = '108' )
( jahr = '2035' j = '31' tab1 = '0.040' tab2 = '0300' tab3 = '090' )
( jahr = '2036' j = '32' tab1 = '0.032' tab2 = '0240' tab3 = '072' )
( jahr = '2037' j = '33' tab1 = '0.024' tab2 = '0180' tab3 = '054' )
( jahr = '2038' j = '34' tab1 = '0.016' tab2 = '0120' tab3 = '036' )
( jahr = '2039' j = '35' tab1 = '0.008' tab2 = '0060' tab3 = '018' )
( jahr = '2040' j = '36' tab1 = '0.000' tab2 = '0000' tab3 = '000' ) ).

By cheking the program, the following Errors Comes:
Feld "VALUE" unbekannt. Es ist weder in einer der angegebenen Tabellen
enthalten noch durch eine "DATA"-Anweisung definiert.

Thanks for a Little tip!
cg

gesponsert
Stellenangebote auf ABAPforum.com schalten
kostenfrei für Ausbildungsberufe und Werksstudenten


Re: Fill a table with value

Beitrag von DeathAndPain (Top Expert / 1964 / 261 / 415 ) »
You post in a German-speaking forum, giving an error message from your system that is in German, too, and still you use English? Hmm...

Either way, your syntax looks fine. However, remember that the VALUE keyword belongs to the new 7.40 instruction set, so if your SAP release is below 7.40, it will not work.

Re: Fill a table with value

Beitrag von cgreiner (ForumUser / 17 / 2 / 0 ) »
Hello,

Sorry, i use english in a german Forum!

Hallo,

Entschuldigen Sie bitte, dass ich in englisch gepostet habe!

Ich bin darauf gekommen, dass die Value-Angabe erst ab Version 7.40 funktioniert, hatte noch mit der Alt-Version 7.20 rumgespielt.

So bin ich eine Erfahrung reicher, hätte mir viel Zeit sparen können (fast ein Tag mit Probieren, Recherchieren), aber ich habe festgestellt, dass da noch sehr viel erklärungsbedarf besteht.

Danke

Claude Greiner

Re: Fill a table with value

Beitrag von cgreiner (ForumUser / 17 / 2 / 0 ) »
Sind die angegebenen Werte mit Value automatisch in die Tabelle gefüllt oder muss hier noch ein Befehl verwendet werden?

cg

Re: Fill a table with value

Beitrag von ralf.wenzel (Top Expert / 3946 / 201 / 281 ) »
cgreiner hat geschrieben:Sind die angegebenen Werte mit Value automatisch in die Tabelle gefüllt oder muss hier noch ein Befehl verwendet werden?

Ja. Nein.


Ralf
Bild
Ralf Wenzel Heuristika SAP-Development
25 Jahre SAP-Entwickler • 20 Jahre Freiberufler
PublikationenUngarische NotationXing

Re: Fill a table with value

Beitrag von DeathAndPain (Top Expert / 1964 / 261 / 415 ) »
Du weist der Tabelle direkt einen kompletten Tabellenkörper als Inhalt zu. Eine sehr geniale Syntax (ebenso wie vieles andere, was neu in 7.40 gekommen ist). Wenn Du Dich mit den neuen Syntaxen mal beschäftigt hast, magst Du Dich mit dem alten ABAP nicht mehr abgeben!

Seite 1 von 1

Vergleichbare Themen

1
Antw.
5394
Views
sorted table, hashed table: Übergabe Workarea -> Performa
von Jürgen Fischer » 30.01.2006 08:09 • Verfasst in ABAP® Core
5
Antw.
10167
Views
standard table vs. sorted table
von ralf.wenzel » 31.07.2014 12:49 • Verfasst in ABAP® Core
44
Antw.
12105
Views
INTO CORRESPONDING FIELDS OF TABLE VS. INtO TABLE
von Bright4.5 » 07.12.2018 13:22 • Verfasst in ABAP® für Anfänger
11
Antw.
5674
Views
table to CSV
von Abapsocke » 18.02.2019 11:29 • Verfasst in ABAP® für Anfänger
6
Antw.
3569
Views
Table Control
von khb » 16.02.2016 10:27 • Verfasst in ABAP® für Anfänger

Über diesen Beitrag


Die Frage ist als "gelöst" markiert. Den entsprechend Beitrag findest du hier.

Unterstütze die Community und teile den Beitrag für mehr Leser und Austausch

Aktuelle Forenbeiträge

Formatierung CSV-Datei durch SAP
Gestern von Radinator gelöst 4 / 149
Post-Methode für API´s
Gestern von Radinator 2 / 372

Newsletter Anmeldung

Keine Beiträge verpassen! Wöchentlich versenden wir lesenwerte Beiträge aus unserer Community.
Die letzte Ausgabe findest du hier.
Details zum Versandverfahren und zu Ihren Widerrufsmöglichkeiten findest du in unserer Datenschutzerklärung.