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: 

BAPI_MATERIAL_SAVEDATA & table bapi_mltx

Former Member
0 Kudos
814

Hi

I am using this function to save material data and I have some questions about long texts; I see that bapi_mltx is the structure I have to use for long texts having this structure:

APPLOBJECT	TDOBJECT	CHAR	10	0	Testi: oggetto applicazione
TEXT_NAME	TDOBNAME	CHAR	70	0	Nome
TEXT_ID	TDID	CHAR	4	0	ID testo
LANGU	TDSPRAS	LANG	1	0	Chiave lingua
LANGU_ISO	LAISO	CHAR	2	0	Lingua (ISO 639)
FORMAT_COL	TDFORMAT	CHAR	2	0	Colonna formato
TEXT_LINE	TDLINE	CHAR	132	0	Riga testo
DEL_FLAG	DELETE_FLAG	CHAR	1	0	Canc. record dati (nelle tabelle di ripetizione)

The questions are:

1) if I have to set more texts (descriptions, sales texts ecc) for more views, I have anyway to put all of them together in bapi_mltx?

2) what should i put in text_line field? if I have a text more than 132 characters have I to put more lines splitting them at 132 characters?

thanks to anyone can halp me

gabriele

Edited by: Gabriele Montori on Jun 10, 2009 11:49 AM

1 ACCEPTED SOLUTION

former_member533584
Contributor
0 Kudos
424

Hi,

You can use MATERIALLONGTEXT to enter multiple long texts for a material .

Pass the parameters as follows

APPLOBJECT = 'MATERIAL'

TEXT_NAME = Material Number (MATNR)

TEXT_ID = ID for corresponding Long text

TEXT_LINE = 'Entera Some text '

then append to MATERIALLONGTEXT. Liek this u can create change or create multiple longtexts.

Regards,

Ananth

4 REPLIES 4

former_member533584
Contributor
0 Kudos
425

Hi,

You can use MATERIALLONGTEXT to enter multiple long texts for a material .

Pass the parameters as follows

APPLOBJECT = 'MATERIAL'

TEXT_NAME = Material Number (MATNR)

TEXT_ID = ID for corresponding Long text

TEXT_LINE = 'Entera Some text '

then append to MATERIALLONGTEXT. Liek this u can create change or create multiple longtexts.

Regards,

Ananth

0 Kudos
424

yes

excuse me if I was not clear while explaining

I know I have to use MATERIALLONGTEXT ... I wrote the type and not the name of the field:

MATERIALLONGTEXT	LIKE	BAPI_MLTX

My question is: if I have more than 132 characters for texts, what I have to do?

split on 132 and then make two insert in this table?

0 Kudos
424

ok.. first split at 132 then for first time put FORMAT_COL as '*' and from the next time onwards put FORMAT_COL as '=' .

Regards,

Ananth

Abdull
Discoverer
0 Kudos
91

hi,

We faced the same issue and resolved it as follows.

When is length of purchase order text is greater than 132 characters, split it using FM 'SWA_STRING_SPLIT' and append it to mltx.

The code should be something like below.

DATAlt_string_comp TYPE STANDARD TABLE OF swastrtab,
          lv_input_str  TYPE string.

lv_input_str wa_matmaster-tdline. "The input string

CALL FUNCTION 'SWA_STRING_SPLIT' 
          EXPORTING
            input_string         lv_input_str     "string to be split
            max_component_length 132
          TABLES
            string_components    lt_string_comp.
        LOOP AT lt_string_comp INTO DATA(ls_string_comp).
          it_mltx-text_name    wa_matmaster-matnr. "Material id
          it_mltx-langu 'EN'.
          it_mltx-applobject 'MATERIAL'.
          it_mltx-text_id 'BEST'.
          it_mltx-text_line ls_string_comp-str.
          APPEND it_mltx.
          CLEAR ls_string_comp.

ENDLOOP.