Here in this code..I had defined a Local variable LV_VBELN LIKE VBRK_VBELN and VBELN is Type c (10).
The function module that I had used in the Import Parameter
you can see the BRANCH...Its type is C (4).
I am passing the value of VBELN to the Import parameter in the function module. As it result it is throwing the short dump.
I need to declare a new Local variable of type c with length 4 and condense the VBELN value into this local variable and pass it to the Functino module.
Can anyone suggest me with the code.
Here is the code.
DATA: ADDRESS LIKE SADR,
BRANCH_RECORD LIKE J_1BBRANCH,
CGC_NUMBER LIKE J_1BWFIELD-CGC_NUMBER,
ADDRESS_VALUE LIKE ADDR1_VAL.
DATA : LV_VBELN LIKE VBRK-VBELN. "Local Variable for vbrk-vbeln
--->Select single bupla into lv_vbeln from vbrk where vbeln EQ is_bil_invoice-hd_gen-bil_number.
CALL FUNCTION 'J_1B_BRANCH_READ'
BRANCH = lv_vbeln
COMPANY = is_bil_invoice-hd_org-comp_code
ADDRESS = ADDRESS
BRANCH_RECORD = BRANCH_RECORD
CGC_NUMBER = CGC_NUMBER
ADDRESS_VALUE = ADDRESS_VALUE
BRANCH_NOT_FOUND = 1
ADDRESS_NOT_FOUND = 2
COMPANY_NOT_FOUND = 3
OTHERS = 4.
IF sy-subrc = 0.
st_txt-cnm1 = ADDRESS-NAME1. " Name 1
st_txt-cnm2 = 'BRAZIL'.
st_txt-cnm3 = ADDRESS-STRAS. " House address & street
st_txt-cnm4 = ADDRESS-ORT01. " City
st_txt-cnm5 = ADDRESS-PSTLZ. " Postal code
st_txt-cnm6 = 'Tel:'.
st_txt-cnm7 = ADDRESS-TELF1 " Telephone no.
st_txt-cnm8 = ADDRESS-TELFX. " Fax number
*Commmented and added to avoid hard code CNPJ
st_txt-cnm9 = 'CNPJ ' + CGC_NUMBER. " CGC number (company,branch,check digits)
CONCATENATE 'CNPJ' CGC_NUMBER INTO st_txt-cnm9 SEPARATED BY SPACE.
**End of changes